Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions .github/workflows/onPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ jobs:
run: |
echo $VERSION_CODE > ./app/build/outputs/version_code.txt

- name: Create draft Github Pre-Release
- name: Create draft 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
Expand All @@ -100,12 +101,30 @@ jobs:
./automotive/build/outputs/apk/minimal/release/automotive-minimal-release.apk
./strings.zip
./app/src/main/res/xml/locales_config.xml
)

# 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'
run: gh release edit ${{ steps.rel_number.outputs.version }} --draft=false
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:
Expand Down