mirror of
https://codeberg.org/gitnex/GitNex
synced 2024-12-23 17:15:49 +01:00
1dd615fcae
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/902 Reviewed-by: M M Arif <mmarif@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.codeberg.org> Co-committed-by: opyale <opyale@noreply.codeberg.org>
101 lines
2.0 KiB
YAML
101 lines
2.0 KiB
YAML
stages:
|
|
- build
|
|
- sign
|
|
- publish
|
|
|
|
on_setup:
|
|
image: tutum/curl
|
|
stage: .pre
|
|
only:
|
|
- main
|
|
- tags
|
|
variables:
|
|
INSTANCE: "https://codeberg.org"
|
|
MAIN_REPO: gitnex/GitNex
|
|
STATE: pending
|
|
script:
|
|
- ./scripts/add-commit-status.sh
|
|
|
|
build:
|
|
image: nextcloudci/android:android-54
|
|
stage: build
|
|
only:
|
|
- main
|
|
- tags
|
|
script:
|
|
- ./gradlew assembleFreeRelease
|
|
artifacts:
|
|
paths:
|
|
- app/build/outputs/
|
|
expire_in: 15 minutes
|
|
|
|
sign:
|
|
image: nextcloudci/android:android-54
|
|
stage: sign
|
|
only:
|
|
- main
|
|
- tags
|
|
variables:
|
|
OUTPUT: "signed.apk"
|
|
INSTANCE: "https://codeberg.org"
|
|
KS_FILE: "ci_keystore.jks"
|
|
script:
|
|
- ./scripts/sign-build.sh
|
|
artifacts:
|
|
paths:
|
|
- signed.apk
|
|
expire_in: 15 minutes
|
|
|
|
latest:
|
|
image: tutum/curl
|
|
stage: publish
|
|
only:
|
|
- main
|
|
- tags
|
|
variables:
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
PLUGIN_FILE: "signed.apk"
|
|
PLUGIN_DESTINATION: "https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/builds/latest.apk"
|
|
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:
|
|
- "[[ $CI_COMMIT_REF_NAME == *'-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_REF_NAME"'.apk'
|
|
|
|
on_success:
|
|
image: tutum/curl
|
|
stage: .post
|
|
only:
|
|
- main
|
|
- tags
|
|
variables:
|
|
INSTANCE: "https://codeberg.org"
|
|
MAIN_REPO: gitnex/GitNex
|
|
STATE: success
|
|
script:
|
|
- ./scripts/add-commit-status.sh
|
|
when: on_success
|
|
|
|
on_failure:
|
|
image: tutum/curl
|
|
stage: .post
|
|
only:
|
|
- main
|
|
- tags
|
|
variables:
|
|
INSTANCE: "https://codeberg.org"
|
|
MAIN_REPO: gitnex/GitNex
|
|
STATE: failure
|
|
script:
|
|
- ./scripts/add-commit-status.sh
|
|
when: on_failure
|