mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
d2ff9b8a8a
Closes #1231 Closes #1280 Closes #1295 Closes #1298 Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1279 Co-authored-by: M M Arif <mmarif@swatian.com> Co-committed-by: M M Arif <mmarif@swatian.com>
50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
steps:
|
|
build:
|
|
image: alvrme/alpine-android:android-32-jdk17
|
|
commands:
|
|
- ./gradlew assembleFreeRelease
|
|
when:
|
|
path: [ app/**, build.gradle ]
|
|
|
|
sign:
|
|
image: alvrme/alpine-android:android-32-jdk17
|
|
environment:
|
|
OUTPUT: "signed.apk"
|
|
INSTANCE: "https://codeberg.org"
|
|
KS_FILE: "gitnex_ci_keystore.jks"
|
|
commands:
|
|
- ./scripts/sign-build.sh
|
|
secrets: [ BOT_TOKEN, KS_PASS, KEY_PASS, KS_REPO ]
|
|
when:
|
|
event: [ push, tag ]
|
|
branch: main
|
|
path: [ app/**, build.gradle ]
|
|
|
|
upload:
|
|
image: curlimages/curl:7.82.0
|
|
group: upload
|
|
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
|
|
path: [ app/**, build.gradle ]
|
|
|
|
upload-release:
|
|
image: curlimages/curl:7.82.0
|
|
group: upload
|
|
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:
|
|
event: [ tag ]
|