2020-07-09 08:55:05 +02:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- sign
|
|
|
|
- publish
|
2022-02-22 16:03:07 +01:00
|
|
|
- locales
|
2020-07-09 08:55:05 +02:00
|
|
|
|
2021-01-26 23:21:47 +01:00
|
|
|
on_setup:
|
2021-06-13 19:38:28 +02:00
|
|
|
image: curlimages/curl:7.77.0
|
2021-01-26 23:21:47 +01:00
|
|
|
stage: .pre
|
2020-09-08 20:44:12 +02:00
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2020-09-08 20:44:12 +02:00
|
|
|
- tags
|
2021-01-26 23:21:47 +01:00
|
|
|
variables:
|
|
|
|
INSTANCE: "https://codeberg.org"
|
|
|
|
MAIN_REPO: gitnex/GitNex
|
|
|
|
STATE: pending
|
2020-07-09 08:55:05 +02:00
|
|
|
script:
|
2021-01-27 10:00:18 +01:00
|
|
|
- ./scripts/add-commit-status.sh
|
2020-07-09 08:55:05 +02:00
|
|
|
|
|
|
|
build:
|
2022-04-04 18:47:40 +02:00
|
|
|
image: alvrme/alpine-android:android-31-jdk11
|
2020-07-09 08:55:05 +02:00
|
|
|
stage: build
|
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2020-09-08 20:44:12 +02:00
|
|
|
- tags
|
2020-07-09 08:55:05 +02:00
|
|
|
script:
|
2020-09-26 20:21:29 +02:00
|
|
|
- ./gradlew assembleFreeRelease
|
2020-07-09 08:55:05 +02:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- app/build/outputs/
|
|
|
|
expire_in: 15 minutes
|
|
|
|
|
|
|
|
sign:
|
2022-04-04 18:47:40 +02:00
|
|
|
image: alvrme/alpine-android:android-31-jdk11
|
2020-07-09 08:55:05 +02:00
|
|
|
stage: sign
|
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2020-09-08 20:44:12 +02:00
|
|
|
- tags
|
2020-07-09 08:55:05 +02:00
|
|
|
variables:
|
|
|
|
OUTPUT: "signed.apk"
|
2020-09-26 20:21:29 +02:00
|
|
|
INSTANCE: "https://codeberg.org"
|
2020-07-09 08:55:05 +02:00
|
|
|
KS_FILE: "ci_keystore.jks"
|
|
|
|
script:
|
|
|
|
- ./scripts/sign-build.sh
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- signed.apk
|
2020-07-09 13:29:36 +02:00
|
|
|
expire_in: 15 minutes
|
2020-07-09 08:55:05 +02:00
|
|
|
|
|
|
|
latest:
|
2021-06-13 19:38:28 +02:00
|
|
|
image: curlimages/curl:7.77.0
|
2020-07-09 08:55:05 +02:00
|
|
|
stage: publish
|
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2020-09-27 00:23:06 +02:00
|
|
|
- tags
|
2020-07-09 08:55:05 +02:00
|
|
|
variables:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
2020-07-09 13:29:36 +02:00
|
|
|
PLUGIN_DESTINATION: "https://cloud.swatian.com/remote.php/dav/files/GitNexBot/gitnex/builds/latest.apk"
|
2020-07-09 08:55:05 +02:00
|
|
|
script:
|
|
|
|
- curl -T "$PLUGIN_FILE" -u "$WEBDAV_USERNAME":"$WEBDAV_PASSWORD" "$PLUGIN_DESTINATION"
|
|
|
|
|
|
|
|
release:
|
2021-06-13 19:38:28 +02:00
|
|
|
image: curlimages/curl:7.77.0
|
2020-07-09 08:55:05 +02:00
|
|
|
stage: publish
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
variables:
|
|
|
|
WEBDAV_USERNAME: "GitNexBot"
|
|
|
|
PLUGIN_FILE: "signed.apk"
|
|
|
|
script:
|
2020-07-09 13:37:44 +02:00
|
|
|
- "[[ $CI_COMMIT_REF_NAME == *'-rc'* ]] && echo 'Upload blocked. Build seems to be a release candidate.' && exit 0"
|
2020-07-09 13:29:36 +02: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'
|
2021-01-26 23:21:47 +01:00
|
|
|
|
2022-02-22 15:03:00 +01:00
|
|
|
push_translations:
|
|
|
|
image: crowdin/cli:3.7.8
|
2022-02-22 16:03:07 +01:00
|
|
|
stage: locales
|
2022-02-22 15:03:00 +01:00
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- main
|
|
|
|
changes:
|
|
|
|
- app/src/main/res/values/strings.xml
|
|
|
|
script:
|
|
|
|
- echo "Set up Crowdin CLI"
|
|
|
|
- cp crowdin.example.yml crowdin.yml
|
2022-02-23 09:49:14 +01:00
|
|
|
- sed -i 's/-removed-/'"$CROWDIN_TOKEN"'/' crowdin.yml
|
2022-02-22 15:03:00 +01:00
|
|
|
- echo "Push translations"
|
|
|
|
- crowdin push
|
|
|
|
|
2021-01-26 23:21:47 +01:00
|
|
|
on_success:
|
2021-06-13 19:38:28 +02:00
|
|
|
image: curlimages/curl:7.77.0
|
2021-01-26 23:21:47 +01:00
|
|
|
stage: .post
|
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2021-01-26 23:21:47 +01:00
|
|
|
- tags
|
|
|
|
variables:
|
|
|
|
INSTANCE: "https://codeberg.org"
|
|
|
|
MAIN_REPO: gitnex/GitNex
|
|
|
|
STATE: success
|
|
|
|
script:
|
2021-01-27 10:00:18 +01:00
|
|
|
- ./scripts/add-commit-status.sh
|
2021-01-26 23:21:47 +01:00
|
|
|
when: on_success
|
|
|
|
|
|
|
|
on_failure:
|
2021-06-13 19:38:28 +02:00
|
|
|
image: curlimages/curl:7.77.0
|
2021-01-26 23:21:47 +01:00
|
|
|
stage: .post
|
|
|
|
only:
|
2021-05-01 20:30:44 +02:00
|
|
|
- main
|
2021-01-26 23:21:47 +01:00
|
|
|
- tags
|
|
|
|
variables:
|
|
|
|
INSTANCE: "https://codeberg.org"
|
|
|
|
MAIN_REPO: gitnex/GitNex
|
|
|
|
STATE: failure
|
|
|
|
script:
|
2021-01-27 10:00:18 +01:00
|
|
|
- ./scripts/add-commit-status.sh
|
2021-01-26 23:21:47 +01:00
|
|
|
when: on_failure
|