2023-09-19 13:23:43 +08:00
|
|
|
steps:
|
2022-05-14 01:35:09 +08:00
|
|
|
build:
|
2023-07-19 02:32:32 +08:00
|
|
|
image: alvrme/alpine-android:android-32-jdk17
|
2022-05-14 01:35:09 +08:00
|
|
|
commands:
|
|
|
|
- ./gradlew assembleFreeRelease
|
|
|
|
when:
|
2022-05-15 20:52:14 +08:00
|
|
|
path: [ app/**, build.gradle ]
|
2022-05-14 01:35:09 +08:00
|
|
|
|
|
|
|
sign:
|
2023-07-19 02:32:32 +08:00
|
|
|
image: alvrme/alpine-android:android-32-jdk17
|
2022-05-14 01:35:09 +08:00
|
|
|
environment:
|
|
|
|
OUTPUT: "signed.apk"
|
|
|
|
INSTANCE: "https://codeberg.org"
|
|
|
|
KS_FILE: "gitnex_ci_keystore.jks"
|
|
|
|
commands:
|
2022-05-16 01:37:34 +08:00
|
|
|
- ./scripts/sign-build.sh
|
2022-05-14 01:35:09 +08:00
|
|
|
secrets: [ BOT_TOKEN, KS_PASS, KEY_PASS, KS_REPO ]
|
|
|
|
when:
|
|
|
|
event: [ push, tag ]
|
|
|
|
branch: main
|
2022-05-15 20:52:14 +08:00
|
|
|
path: [ app/**, build.gradle ]
|
2022-05-14 01:35:09 +08:00
|
|
|
|
|
|
|
upload:
|
|
|
|
image: curlimages/curl:7.82.0
|
|
|
|
environment:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
|
|
|
PLUGIN_DESTINATION: "https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/builds/latest.apk"
|
|
|
|
commands:
|
|
|
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" "$PLUGIN_DESTINATION"
|
|
|
|
secrets: [ WEBDAV_PASSWORD ]
|
|
|
|
when:
|
|
|
|
event: [ push, tag ]
|
|
|
|
branch: main
|
2022-05-15 20:52:14 +08:00
|
|
|
path: [ app/**, build.gradle ]
|
2022-05-14 01:35:09 +08:00
|
|
|
|
|
|
|
upload-release:
|
|
|
|
image: curlimages/curl:7.82.0
|
|
|
|
environment:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
|
|
|
commands:
|
|
|
|
- "[[ $CI_COMMIT_TAG == *'-rc'* ]] && echo 'Upload blocked. Build seems to be a release candidate.' && exit 0"
|
|
|
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" 'https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/releases/'"$CI_COMMIT_TAG"'.apk'
|
|
|
|
secrets: [ WEBDAV_PASSWORD ]
|
|
|
|
when:
|
2022-05-15 20:52:14 +08:00
|
|
|
event: [ tag ]
|