From eb34d32955d4d24f05b95377b451d4ee29c5fb79 Mon Sep 17 00:00:00 2001 From: Timothy <6560631+TimoPtr@users.noreply.github.com> Date: Wed, 20 May 2026 16:09:28 +0200 Subject: [PATCH 1/3] Use GH instead of softprops/action-gh-release --- .github/workflows/onPush.yml | 37 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/onPush.yml b/.github/workflows/onPush.yml index 3d677b08768..68c48c560c2 100644 --- a/.github/workflows/onPush.yml +++ b/.github/workflows/onPush.yml @@ -83,15 +83,16 @@ jobs: run: | echo $VERSION_CODE > ./app/build/outputs/version_code.txt - - name: Create draft Github Pre-Release + - name: Create or update GitHub Pre-Release if: github.event.inputs.beta == 'true' - uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0 - with: - tag_name: ${{ steps.rel_number.outputs.version }} - body_path: ./app/build/outputs/changelogGithub - draft: true - prerelease: true - files: | + shell: bash + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REL_VERSION: ${{ steps.rel_number.outputs.version }} + run: | + set -euo pipefail + + assets=( ./app/build/outputs/apk/full/release/app-full-release.apk ./app/build/outputs/apk/minimal/release/app-minimal-release.apk ./app/build/outputs/version_code.txt @@ -100,12 +101,20 @@ jobs: ./automotive/build/outputs/apk/minimal/release/automotive-minimal-release.apk ./strings.zip ./app/src/main/res/xml/locales_config.xml - - - name: Publish Pre-Release - if: github.event.inputs.beta == 'true' - run: gh release edit ${{ steps.rel_number.outputs.version }} --draft=false - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ) + + # If the prerelease already exists, publish it by updating assets and clearing draft mode. + if gh release view "$REL_VERSION" >/dev/null 2>&1; then + gh release upload "$REL_VERSION" "${assets[@]}" --clobber + gh release edit "$REL_VERSION" \ + --draft=false \ + --prerelease \ + --notes-file ./app/build/outputs/changelogGithub + else + gh release create "$REL_VERSION" "${assets[@]}" \ + --prerelease \ + --notes-file ./app/build/outputs/changelogGithub + fi - name: Deploy to Firebase env: From 613ed9369dc73470d8be5782ed15b43811be79f1 Mon Sep 17 00:00:00 2001 From: Timothy <6560631+TimoPtr@users.noreply.github.com> Date: Wed, 20 May 2026 16:32:18 +0200 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/onPush.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/onPush.yml b/.github/workflows/onPush.yml index 68c48c560c2..f2258a8d195 100644 --- a/.github/workflows/onPush.yml +++ b/.github/workflows/onPush.yml @@ -103,7 +103,7 @@ jobs: ./app/src/main/res/xml/locales_config.xml ) - # If the prerelease already exists, publish it by updating assets and clearing draft mode. + # If a release already exists for this tag, update its assets and release metadata. if gh release view "$REL_VERSION" >/dev/null 2>&1; then gh release upload "$REL_VERSION" "${assets[@]}" --clobber gh release edit "$REL_VERSION" \ From b7c1d747de1a1d4a773f1083754dc819dedf98be Mon Sep 17 00:00:00 2001 From: Timothy <6560631+TimoPtr@users.noreply.github.com> Date: Thu, 21 May 2026 13:12:24 +0200 Subject: [PATCH 3/3] Allow re-run on failure before publishing --- .github/workflows/onPush.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/onPush.yml b/.github/workflows/onPush.yml index f2258a8d195..bf8bfc0e3a0 100644 --- a/.github/workflows/onPush.yml +++ b/.github/workflows/onPush.yml @@ -83,7 +83,7 @@ jobs: run: | echo $VERSION_CODE > ./app/build/outputs/version_code.txt - - name: Create or update GitHub Pre-Release + - name: Create draft GitHub Pre-Release if: github.event.inputs.beta == 'true' shell: bash env: @@ -103,19 +103,29 @@ jobs: ./app/src/main/res/xml/locales_config.xml ) - # If a release already exists for this tag, update its assets and release metadata. - if gh release view "$REL_VERSION" >/dev/null 2>&1; then - gh release upload "$REL_VERSION" "${assets[@]}" --clobber - gh release edit "$REL_VERSION" \ - --draft=false \ - --prerelease \ - --notes-file ./app/build/outputs/changelogGithub - else - gh release create "$REL_VERSION" "${assets[@]}" \ + # Immutable releases lock their assets at publish time, so we create the release as a + # draft first and attach assets while it is still mutable. The next step publishes it. + # On re-runs, --clobber keeps the upload idempotent as long as the previous attempt + # did not get past the publish step. + if ! gh release view "$REL_VERSION" >/dev/null 2>&1; then + gh release create "$REL_VERSION" \ + --draft \ --prerelease \ --notes-file ./app/build/outputs/changelogGithub fi + gh release upload "$REL_VERSION" "${assets[@]}" --clobber + + - name: Publish Pre-Release + if: github.event.inputs.beta == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REL_VERSION: ${{ steps.rel_number.outputs.version }} + run: | + gh release edit "$REL_VERSION" \ + --draft=false \ + --notes-file ./app/build/outputs/changelogGithub + - name: Deploy to Firebase env: KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}