2020-07-09 14:55:05 +08:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- sign
|
|
|
|
- publish
|
|
|
|
|
|
|
|
test:
|
|
|
|
image: nextcloudci/android:android-49
|
|
|
|
stage: test
|
2020-09-09 02:44:12 +08:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- tags
|
2020-07-09 14:55:05 +08:00
|
|
|
script:
|
|
|
|
- ./gradlew test
|
|
|
|
|
|
|
|
build:
|
|
|
|
image: nextcloudci/android:android-49
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- master
|
2020-09-09 02:44:12 +08:00
|
|
|
- tags
|
2020-07-09 14:55:05 +08:00
|
|
|
script:
|
2020-09-27 02:21:29 +08:00
|
|
|
- ./gradlew assembleFreeRelease
|
2020-07-09 14:55:05 +08:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- app/build/outputs/
|
|
|
|
expire_in: 15 minutes
|
|
|
|
|
|
|
|
sign:
|
|
|
|
image: nextcloudci/android:android-49
|
|
|
|
stage: sign
|
|
|
|
only:
|
|
|
|
- master
|
2020-09-09 02:44:12 +08:00
|
|
|
- tags
|
2020-07-09 14:55:05 +08:00
|
|
|
variables:
|
|
|
|
OUTPUT: "signed.apk"
|
2020-09-27 02:21:29 +08:00
|
|
|
INSTANCE: "https://codeberg.org"
|
2020-07-09 14:55:05 +08:00
|
|
|
KS_FILE: "ci_keystore.jks"
|
|
|
|
script:
|
|
|
|
- ./scripts/sign-build.sh
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- signed.apk
|
2020-07-09 19:29:36 +08:00
|
|
|
expire_in: 15 minutes
|
2020-07-09 14:55:05 +08:00
|
|
|
|
|
|
|
latest:
|
|
|
|
image: tutum/curl
|
|
|
|
stage: publish
|
|
|
|
only:
|
|
|
|
- master
|
2020-09-27 06:23:06 +08:00
|
|
|
- tags
|
2020-07-09 14:55:05 +08:00
|
|
|
variables:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
2020-07-09 19:29:36 +08:00
|
|
|
PLUGIN_DESTINATION: "https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/builds/latest.apk"
|
2020-07-09 14:55:05 +08:00
|
|
|
script:
|
|
|
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" "$PLUGIN_DESTINATION"
|
|
|
|
|
|
|
|
release:
|
|
|
|
image: tutum/curl
|
|
|
|
stage: publish
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
variables:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
|
|
|
script:
|
2020-07-09 19:37:44 +08:00
|
|
|
- "[[ $CI_COMMIT_REF_NAME == *'-rc'* ]] && echo 'Upload blocked. Build seems to be a release candidate.' && exit 0"
|
2020-07-09 19:29:36 +08:00
|
|
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/releases/'"$CI_COMMIT_REF_NAME"'.apk'
|