Skip to content

Commit aeb8334

Browse files
t3dotggclaude
andcommitted
ci(release): nightly APK handoff uses only this attempt's artifact ID
The release job downloaded by name pattern, so when a producer rerun found no Play build it still picked the previous attempt's APK. android_apk now outputs the artifact ID only when this attempt's upload succeeded, and release downloads that ID only when it is nonempty. Each android_apk step has its own timeout and continue-on-error, summing under the job timeout, because a failed or cancelled ancestor would skip publish_cli and the jobs after it. The credential precheck and the hashFiles condition are gone: the script writes only a complete APK and the upload ignores an empty directory. Retention is 30 days, the failed-jobs rerun window, so a later publisher-only retry keeps the APK. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f682c51 commit aeb8334

1 file changed

Lines changed: 26 additions & 28 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -754,43 +754,36 @@ jobs:
754754
resource_key: win32-arm64
755755
cli_archive: true
756756

757-
# Nightlies attach Play's internal APK (~280 MB). The Play download is slow,
758-
# so it runs here beside the desktop builds and the publish job only copies a
759-
# finished artifact. The APK is optional: every step tolerates failure, and
760-
# job-level continue-on-error keeps a runner fault from failing the release.
757+
# Nightlies attach Play's optional internal APK (~280 MB), fetched here beside
758+
# the desktop builds. A failed ancestor skips every job after release, and a
759+
# job timeout cancels steps past continue-on-error, so each step has its own
760+
# timeout and continue-on-error, and they sum to less than the job timeout.
761761
android_apk:
762762
name: Stage nightly Android APK
763763
needs: [preflight]
764764
if: needs.preflight.outputs.release_channel == 'nightly'
765765
runs-on: blacksmith-2vcpu-ubuntu-2404
766-
timeout-minutes: 10
766+
timeout-minutes: 15
767767
continue-on-error: true
768768
permissions:
769769
contents: read
770+
outputs:
771+
# Only this attempt's successful upload, so a rerun that finds no APK
772+
# never hands release an earlier attempt's artifact.
773+
apk_artifact_id: ${{ steps.upload.outcome == 'success' && steps.upload.outputs.artifact-id || '' }}
770774
steps:
771-
- id: credentials
772-
name: Check for Play credentials
773-
env:
774-
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
775-
run: |
776-
if [ -n "$GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" ]; then
777-
echo "present=true" >> "$GITHUB_OUTPUT"
778-
else
779-
echo "present=false" >> "$GITHUB_OUTPUT"
780-
echo "GOOGLE_PLAY_SERVICE_ACCOUNT_JSON is not available; skipping the APK."
781-
fi
782-
783775
- name: Checkout
784-
if: steps.credentials.outputs.present == 'true'
776+
continue-on-error: true
777+
timeout-minutes: 2
785778
uses: actions/checkout@v6
786779
with:
787780
ref: ${{ needs.preflight.outputs.ref }}
788781
sparse-checkout: .github/scripts
789782

790-
# Writes the APK only when Play has a processed internal build.
783+
# Writes the complete APK only when Play has a processed internal build.
784+
# Without credentials it fails, and the release goes out without an APK.
791785
- id: mirror
792786
name: Download internal Android APK
793-
if: steps.credentials.outputs.present == 'true'
794787
continue-on-error: true
795788
timeout-minutes: 5
796789
env:
@@ -799,17 +792,21 @@ jobs:
799792
APK_OUTPUT_DIR: android-apk
800793
run: node .github/scripts/mirror-play-apk.cjs
801794

802-
- name: Upload Android APK
803-
if: steps.mirror.outcome == 'success' && hashFiles('android-apk/*.apk') != ''
795+
# With no APK, nothing uploads and artifact-id stays empty.
796+
- id: upload
797+
name: Upload Android APK
798+
if: steps.mirror.outcome == 'success'
804799
continue-on-error: true
800+
timeout-minutes: 3
805801
uses: actions/upload-artifact@v7
806802
with:
807803
name: android-apk
808804
path: android-apk/*.apk
809805
if-no-files-found: ignore
810806
# APKs are already zip-compressed.
811807
compression-level: 0
812-
retention-days: 1
808+
# GitHub allows a failed-jobs rerun for 30 days.
809+
retention-days: 30
813810

814811
release:
815812
name: Publish GitHub Release
@@ -870,18 +867,19 @@ jobs:
870867
merge-multiple: true
871868
path: release-assets
872869

873-
# Downloads go to a staging directory so a failed transfer cannot leave a
874-
# partial APK among the release assets.
870+
# By ID only: an empty ID would download every artifact in the run. The
871+
# staging directory keeps a failed or mismatched transfer out of the
872+
# release assets.
875873
- id: android_apk
876874
name: Download nightly Android APK
877-
if: needs.preflight.outputs.release_channel == 'nightly'
875+
if: needs.android_apk.outputs.apk_artifact_id != ''
878876
continue-on-error: true
879877
timeout-minutes: 2
880878
uses: actions/download-artifact@v8
881879
with:
882-
pattern: android-apk
883-
merge-multiple: true
880+
artifact-ids: ${{ needs.android_apk.outputs.apk_artifact_id }}
884881
path: android-apk
882+
digest-mismatch: error
885883

886884
- name: Add nightly Android APK
887885
if: steps.android_apk.outcome == 'success'

0 commit comments

Comments
 (0)