2023-08-11 19:12:01 +02:00
|
|
|
clone:
|
|
|
|
git:
|
|
|
|
image: woodpeckerci/plugin-git
|
|
|
|
settings:
|
|
|
|
partial: false
|
2023-08-11 18:36:23 +02:00
|
|
|
|
2023-08-11 17:59:01 +02:00
|
|
|
steps:
|
2023-08-12 12:40:14 +02:00
|
|
|
check-if-released:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2024-10-27 15:18:08 +01:00
|
|
|
secrets:
|
|
|
|
- hc_url_nightly_deploy
|
2023-08-12 12:40:14 +02:00
|
|
|
commands: |
|
2024-10-28 00:11:20 +01:00
|
|
|
curl -fsS -m 10 --retry 5 "$${HC_URL_NIGHTLY_DEPLOY}/start"
|
2024-10-27 15:18:08 +01:00
|
|
|
|
2023-08-12 12:40:14 +02:00
|
|
|
RELEASED_VERSION_CODE=$(curl https://freeyourgadget.codeberg.page/fdroid/repo/index-v1.json | jq '.packages."nodomain.freeyourgadget.gadgetbridge.nightly"[0].versionCode')
|
|
|
|
CURRENT_VERSION_CODE=$(git rev-list HEAD --count)
|
|
|
|
|
|
|
|
echo $CURRENT_VERSION_CODE
|
|
|
|
echo $RELEASED_VERSION_CODE
|
|
|
|
if [ "$RELEASED_VERSION_CODE" = "$CURRENT_VERSION_CODE" ]
|
|
|
|
then
|
2023-08-12 15:12:17 +02:00
|
|
|
echo "This version is already released, we quit!"
|
|
|
|
touch .do_not_build
|
2024-10-28 00:11:20 +01:00
|
|
|
curl -fsS -m 10 --retry 5 "$${HC_URL_NIGHTLY_DEPLOY}"
|
2023-08-12 12:40:14 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2023-08-11 17:59:01 +02:00
|
|
|
build-apks:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2023-08-12 15:12:17 +02:00
|
|
|
- if [ -f .do_not_build ]; then return 0; fi
|
2023-08-11 17:59:01 +02:00
|
|
|
# build the apks
|
|
|
|
- echo "$${SIGNING_KEY}" | base64 -d > app/keystore.p12
|
2024-01-19 18:49:37 +01:00
|
|
|
- ./gradlew assembleMainlineNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
|
|
|
|
- ./gradlew assembleMainlineNopebble -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
|
2023-08-11 17:59:01 +02:00
|
|
|
- ./gradlew assembleBanglejsNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
|
|
|
|
secrets: [ signing_key, keystorepass, keypass ]
|
|
|
|
|
|
|
|
pull-repo-config:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2023-08-12 15:12:17 +02:00
|
|
|
- if [ -f .do_not_build ]; then return 0; fi
|
2023-08-11 17:59:01 +02:00
|
|
|
- cd ..
|
|
|
|
- pwd
|
|
|
|
- mkdir repoconfig
|
|
|
|
- cd repoconfig
|
|
|
|
- pwd
|
|
|
|
- git clone --depth 1 https://codeberg.org/Freeyourgadget/fdroid-repo-config.git
|
|
|
|
- ./fdroid-repo-config/repoconfig/copy_files_to_repo_config.sh
|
|
|
|
secrets: [ commit_token ]
|
|
|
|
|
|
|
|
pull-pages:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2023-08-12 15:12:17 +02:00
|
|
|
- if [ -f .do_not_build ]; then return 0; fi
|
2023-08-11 17:59:01 +02:00
|
|
|
# prepare the pages repo, so fdroidclient can push files into it later
|
|
|
|
- cd ..
|
|
|
|
- pwd
|
|
|
|
- mkdir pages
|
|
|
|
- cd pages
|
|
|
|
- pwd
|
|
|
|
- git clone --depth 2 https://codeberg.org/Freeyourgadget/pages.git
|
|
|
|
- cd pages
|
|
|
|
- git config user.name "CODEBERG CI"
|
|
|
|
- git config user.email "noreply@nodomain.nodomain"
|
|
|
|
# reset and remove, later force push, to keep repo size small
|
|
|
|
- git reset --soft HEAD~1
|
|
|
|
- git status
|
|
|
|
#- rm -f fdroid/repo/*apk
|
|
|
|
|
|
|
|
update-fdroid-data:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2023-08-12 15:12:17 +02:00
|
|
|
- if [ -f .do_not_build ]; then return 0; fi
|
2023-08-11 17:59:01 +02:00
|
|
|
- pwd
|
|
|
|
- ../repoconfig/fdroid-repo-config/repoconfig/prepare_changelog.sh
|
|
|
|
- cd ../repoconfig/fdroid-repo-config/repoconfig
|
|
|
|
# get secrets from storage
|
|
|
|
- echo "$${SIGNING_KEY}" | base64 -d > keystore.p12
|
|
|
|
- sed -i "s#KEYSTOREPASS_PLACEHOLDER#$${KEYSTOREPASS}#g" config.yml
|
|
|
|
- sed -i "s#KEYPASS_PLACEHOLDER#$${KEYPASS}#g" config.yml
|
|
|
|
- fdroid update
|
|
|
|
- cp ./repo/nodomain.freeyourgadget.gadgetbridge.nightly/en-US/icon.png ./repo/icons/icon.png
|
|
|
|
- python3 repo_listing.py > listing.html
|
|
|
|
- sed -i "s#</body>#LISTING\n</body>#" ./repo/index.html
|
|
|
|
- sed -i -e "/LISTING/r listing.html" -e '//d' ./repo/index.html
|
|
|
|
- fdroid deploy
|
|
|
|
- ls -laR repo
|
|
|
|
secrets: [ signing_key, keystorepass, keypass ]
|
|
|
|
|
|
|
|
push-pages-update-repo:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2023-08-12 15:12:17 +02:00
|
|
|
- if [ -f .do_not_build ]; then return 0; fi
|
2023-08-11 17:59:01 +02:00
|
|
|
- cd ../pages/pages/
|
|
|
|
- git add -A
|
|
|
|
- git status
|
|
|
|
- git diff
|
|
|
|
- ls -lsR fdroid/repo
|
|
|
|
- git commit -m "autodeploy, $${DRONE_COMMIT_MESSAGE}"
|
|
|
|
- git remote remove origin
|
|
|
|
- git remote add origin https://"$${COMMIT_TOKEN}"@codeberg.org/Freeyourgadget/pages.git
|
|
|
|
# force push as we removed all data
|
|
|
|
- git push -f origin master
|
|
|
|
- cd ../../
|
|
|
|
- pwd
|
|
|
|
- ls -la
|
|
|
|
- ./repoconfig/fdroid-repo-config/repoconfig/hyperlink.sh https://freeyourgadget.codeberg.page/fdroid/repo/
|
|
|
|
# bump
|
|
|
|
secrets: [ commit_token ]
|
|
|
|
|
2024-10-27 15:18:08 +01:00
|
|
|
on-success:
|
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
|
|
|
commands:
|
2024-10-28 00:11:20 +01:00
|
|
|
- curl -fsS -m 10 --retry 5 "$${HC_URL_NIGHTLY_DEPLOY}"
|
2024-10-27 15:18:08 +01:00
|
|
|
when:
|
|
|
|
status: success
|
|
|
|
secrets:
|
|
|
|
- hc_url_nightly_deploy
|
|
|
|
|
2023-08-11 17:59:01 +02:00
|
|
|
on-error:
|
2023-10-08 21:46:31 +02:00
|
|
|
image: codeberg.org/freeyourgadget/android-fdroid-tools:33.0.0
|
2023-08-11 17:59:01 +02:00
|
|
|
commands:
|
2024-10-28 00:11:20 +01:00
|
|
|
- curl -fsS -m 10 --retry 5 "$${HC_URL_NIGHTLY_DEPLOY}/fail"
|
2023-08-11 17:59:01 +02:00
|
|
|
- cd ..
|
|
|
|
- mkdir -p repoconfig
|
|
|
|
- cd repoconfig
|
|
|
|
- git clone --depth 1 https://codeberg.org/Freeyourgadget/fdroid-repo-config.git || true
|
|
|
|
- ./fdroid-repo-config/repoconfig/create_issue_comment.sh "CI failed"
|
|
|
|
when:
|
|
|
|
status: failure
|
2024-10-27 15:18:08 +01:00
|
|
|
secrets:
|
|
|
|
- hc_url_nightly_deploy
|
|
|
|
- commit_token
|
2023-09-07 14:00:07 +02:00
|
|
|
|
2023-08-11 17:59:01 +02:00
|
|
|
when:
|
2023-09-07 14:00:07 +02:00
|
|
|
- event: cron
|
|
|
|
- event: deployment
|
|
|
|
branch: master
|
|
|
|
evaluate: 'CI_PIPELINE_DEPLOY_TARGET == "nightly"'
|