Skip to content
Open
Show file tree
Hide file tree
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
44 changes: 32 additions & 12 deletions .github/workflows/android-play-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ permissions:
contents: read

jobs:
deploy_internal:
name: Build and upload internal testing draft
validate_and_build:
name: Check and build signed app bundle
runs-on: ubuntu-latest
environment: release
env:
Expand Down Expand Up @@ -53,7 +53,6 @@ jobs:
env:
ANDROID_GOOGLE_SERVICES_JSON_B64: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON_B64 }}
ANDROID_UPLOAD_KEYSTORE_B64: ${{ secrets.ANDROID_UPLOAD_KEYSTORE_B64 }}
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
run: |
missing=0
for name in \
Expand All @@ -62,7 +61,6 @@ jobs:
ANDROID_KEYSTORE_PASSWORD \
ANDROID_KEY_ALIAS \
ANDROID_KEY_PASSWORD \
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON \
REST_API_URL
do
if [ -z "${!name}" ]; then
Expand Down Expand Up @@ -106,14 +104,6 @@ jobs:
- name: Build Android app bundle
run: flutter build appbundle --release --dart-define=REST_API_URL="$REST_API_URL"

- name: Prepare Play release notes
if: ${{ inputs.release_notes != '' }}
env:
RELEASE_NOTES: ${{ inputs.release_notes }}
run: |
mkdir -p distribution/whatsnew
printf '%s\n' "$RELEASE_NOTES" > distribution/whatsnew/whatsnew-en-US

- name: Upload signed app bundle artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -122,6 +112,36 @@ jobs:
if-no-files-found: error
retention-days: 14

upload_internal:
name: Upload internal testing draft
runs-on: ubuntu-latest
needs: validate_and_build
environment: release

steps:
- name: Validate Google Play credentials
env:
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
run: |
if [ -z "$GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" ]; then
echo "GOOGLE_PLAY_SERVICE_ACCOUNT_JSON is required for Android Play upload." >&2
exit 1
fi

- name: Download signed app bundle artifact
uses: actions/download-artifact@v4
with:
name: ontime-android-release-aab
path: build/app/outputs/bundle/release

- name: Prepare Play release notes
if: ${{ inputs.release_notes != '' }}
env:
RELEASE_NOTES: ${{ inputs.release_notes }}
run: |
mkdir -p distribution/whatsnew
printf '%s\n' "$RELEASE_NOTES" > distribution/whatsnew/whatsnew-en-US

- name: Upload internal testing draft with release notes
if: ${{ inputs.release_notes != '' }}
uses: r0adkll/upload-google-play@v1
Expand Down
4 changes: 4 additions & 0 deletions docs/Android-Release-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ uploads the signed `.aab` as a 14-day GitHub Actions artifact and creates a
draft release on Google Play Internal Testing. If the optional release notes
input is empty, the workflow uploads without custom release notes.

The workflow is split into a build/check job and a Play upload job. If the
upload fails after the `.aab` artifact is built, use GitHub Actions' rerun
failed jobs option to retry only the upload job.

`pubspec.yaml` remains the source of truth for `version: major.minor.patch+build`.
Before dispatching the workflow, bump the build number so it is greater than
every previously uploaded Google Play build for `club.devkor.ontime`. Duplicate
Expand Down
Loading