diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index af13990..4ec9407 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -28,28 +28,18 @@ jobs: echo $VERSION > version.txt echo "Detected version: $VERSION" - - name: Check if tag exists + - name: Stop if version already released + id: stop run: | VERSION=$(cat version.txt) if git show-ref --tags --quiet --verify "refs/tags/$VERSION"; then - echo "Tag '$VERSION' already exists." - echo true > tag_exists.txt + echo "Version $VERSION already released, stopping job." + echo "continue=false" >> $GITHUB_OUTPUT else - echo "Tag '$VERSION' does not exist yet." - echo false > tag_exists.txt + echo "Version $VERSION not released yet, continuing workflow..." + echo "continue=true" >> $GITHUB_OUTPUT fi - - name: Stop if version already released - run: | - EXISTS=$(cat tag_exists.txt | tr -d '[:space:]') - if [ "$EXISTS" = "true" ]; then - echo "Version already released, skipping workflow." - exit 0 - else - echo "Version not released yet, continuing workflow..." - fi - - - name: Decode keystore run: | mkdir -p app @@ -79,6 +69,7 @@ jobs: echo "PATH=$HOME/Android/sdk/cmdline-tools/latest/bin:$HOME/Android/sdk/platform-tools:$PATH" >> $GITHUB_ENV - name: Build Release APK + if: steps.stop.outputs.continue == 'true' env: KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} KEY_ALIAS: ${{ secrets.KEY_ALIAS }}