Skip to content

Commit 471bcac

Browse files
TimoPtrCopilot
andauthored
Use GH instead of softprops/action-gh-release (#6873)
--------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent eb95e77 commit 471bcac

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/onPush.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,16 @@ jobs:
8383
run: |
8484
echo $VERSION_CODE > ./app/build/outputs/version_code.txt
8585
86-
- name: Create draft Github Pre-Release
86+
- name: Create draft GitHub Pre-Release
8787
if: github.event.inputs.beta == 'true'
88-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
89-
with:
90-
tag_name: ${{ steps.rel_number.outputs.version }}
91-
body_path: ./app/build/outputs/changelogGithub
92-
draft: true
93-
prerelease: true
94-
files: |
88+
shell: bash
89+
env:
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
REL_VERSION: ${{ steps.rel_number.outputs.version }}
92+
run: |
93+
set -euo pipefail
94+
95+
assets=(
9596
./app/build/outputs/apk/full/release/app-full-release.apk
9697
./app/build/outputs/apk/minimal/release/app-minimal-release.apk
9798
./app/build/outputs/version_code.txt
@@ -100,12 +101,30 @@ jobs:
100101
./automotive/build/outputs/apk/minimal/release/automotive-minimal-release.apk
101102
./strings.zip
102103
./app/src/main/res/xml/locales_config.xml
104+
)
105+
106+
# Immutable releases lock their assets at publish time, so we create the release as a
107+
# draft first and attach assets while it is still mutable. The next step publishes it.
108+
# On re-runs, --clobber keeps the upload idempotent as long as the previous attempt
109+
# did not get past the publish step.
110+
if ! gh release view "$REL_VERSION" >/dev/null 2>&1; then
111+
gh release create "$REL_VERSION" \
112+
--draft \
113+
--prerelease \
114+
--notes-file ./app/build/outputs/changelogGithub
115+
fi
116+
117+
gh release upload "$REL_VERSION" "${assets[@]}" --clobber
103118
104119
- name: Publish Pre-Release
105120
if: github.event.inputs.beta == 'true'
106-
run: gh release edit ${{ steps.rel_number.outputs.version }} --draft=false
107121
env:
108122
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
REL_VERSION: ${{ steps.rel_number.outputs.version }}
124+
run: |
125+
gh release edit "$REL_VERSION" \
126+
--draft=false \
127+
--notes-file ./app/build/outputs/changelogGithub
109128
110129
- name: Deploy to Firebase
111130
env:

0 commit comments

Comments
 (0)