From c939dc279098978975b0fe35c7c9f30b71ef6920 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Sat, 8 Aug 2026 15:43:51 -0700 Subject: [PATCH] ci: give the release dry-run an unused android version code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Play rejects a version code it has already seen, and between releases pubspec's code is by definition already published — so every scheduled dry-run died on "Version code 69 has already been used" before reaching any of the credential, signing, or store validation it exists to check. It has been failing on that since 5.1.0 shipped. Overrides the build number with epoch seconds, which is always unused and always increasing. The bundle is validate_only, never published, so the value is discarded. Only downside is the dry-run can no longer catch a forgotten version bump, which the real release catches anyway. Co-Authored-By: Claude Opus 5 --- .github/workflows/release-dryrun.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-dryrun.yml b/.github/workflows/release-dryrun.yml index b3c31b44..fd6d0c2d 100644 --- a/.github/workflows/release-dryrun.yml +++ b/.github/workflows/release-dryrun.yml @@ -69,8 +69,16 @@ jobs: echo storeFile=$GITHUB_WORKSPACE/android/upload-keystore.jks >> $KEY_FILE_PATH # Build the Android app bundle (AAB) and pass the environment variables. + # + # The version code is overridden because Play rejects one it has already + # seen, and pubspec's code is by definition already published between + # releases — so the dry-run would fail on every scheduled run and never + # reach the validation it exists to perform. Epoch seconds is always + # unused, always increasing, and well under Play's 2100000000 cap. The + # bundle is only ever validated, never published, so the value is thrown + # away. versionName still comes from pubspec. - name: Build the Android AAB - run: flutter build appbundle --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET + run: flutter build appbundle --build-number=$(date +%s) --dart-define CLIENT_ID=$CLIENT_ID --dart-define SECRET=$SECRET # Validate the AAB and credentials against Google Play without publishing. - name: Validate release with fastlane (no publish)