From f86cd3938568426af05a7fc203a776b7dd2aff5a Mon Sep 17 00:00:00 2001 From: vanous Date: Sat, 12 Aug 2023 12:40:14 +0200 Subject: [PATCH] Add CI filter to skip nightly if already released This will cause the CI to produce a Failure if already released, but it can prevent many unnecesary CI runs, which is prefferable. We can remove this filter if the Failure is confussing. --- .woodpecker/nightly.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.woodpecker/nightly.yml b/.woodpecker/nightly.yml index ed1bac0e4..caa4416f6 100644 --- a/.woodpecker/nightly.yml +++ b/.woodpecker/nightly.yml @@ -5,6 +5,21 @@ clone: partial: false steps: + check-if-released: + image: codeberg.org/freeyourgadget/android-fdroid-tools:latest + commands: | + 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 + echo "This version is already released, quit!" + return 1 + fi + + build-apks: image: codeberg.org/freeyourgadget/android-fdroid-tools:latest commands: