Skip to content

Commit f682c51

Browse files
t3dotggclaude
andcommitted
perf(release): fetch the nightly Android APK beside the desktop builds
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c8267db commit f682c51

1 file changed

Lines changed: 78 additions & 7 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,63 @@ 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.
761+
android_apk:
762+
name: Stage nightly Android APK
763+
needs: [preflight]
764+
if: needs.preflight.outputs.release_channel == 'nightly'
765+
runs-on: blacksmith-2vcpu-ubuntu-2404
766+
timeout-minutes: 10
767+
continue-on-error: true
768+
permissions:
769+
contents: read
770+
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+
783+
- name: Checkout
784+
if: steps.credentials.outputs.present == 'true'
785+
uses: actions/checkout@v6
786+
with:
787+
ref: ${{ needs.preflight.outputs.ref }}
788+
sparse-checkout: .github/scripts
789+
790+
# Writes the APK only when Play has a processed internal build.
791+
- id: mirror
792+
name: Download internal Android APK
793+
if: steps.credentials.outputs.present == 'true'
794+
continue-on-error: true
795+
timeout-minutes: 5
796+
env:
797+
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
798+
PACKAGE_NAME: com.t3tools.t3code
799+
APK_OUTPUT_DIR: android-apk
800+
run: node .github/scripts/mirror-play-apk.cjs
801+
802+
- name: Upload Android APK
803+
if: steps.mirror.outcome == 'success' && hashFiles('android-apk/*.apk') != ''
804+
continue-on-error: true
805+
uses: actions/upload-artifact@v7
806+
with:
807+
name: android-apk
808+
path: android-apk/*.apk
809+
if-no-files-found: ignore
810+
# APKs are already zip-compressed.
811+
compression-level: 0
812+
retention-days: 1
813+
757814
release:
758815
name: Publish GitHub Release
759816
needs:
@@ -770,7 +827,10 @@ jobs:
770827
desktop_linux_arm64,
771828
desktop_win_x64,
772829
desktop_win_arm64,
830+
android_apk,
773831
]
832+
# android_apk is absent from this check on purpose: it is optional and
833+
# skipped outside nightly.
774834
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.test.result == 'success' && needs.test_web.result == 'success' && needs.test_server.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_mac_x64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }}
775835
runs-on: blacksmith-8vcpu-ubuntu-2404
776836
timeout-minutes: 30
@@ -810,16 +870,27 @@ jobs:
810870
merge-multiple: true
811871
path: release-assets
812872

813-
- name: Download internal Android APK for Nightly
873+
# Downloads go to a staging directory so a failed transfer cannot leave a
874+
# partial APK among the release assets.
875+
- id: android_apk
876+
name: Download nightly Android APK
814877
if: needs.preflight.outputs.release_channel == 'nightly'
815878
continue-on-error: true
816-
env:
817-
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
818-
PACKAGE_NAME: com.t3tools.t3code
819-
APK_OUTPUT_DIR: release-assets
879+
timeout-minutes: 2
880+
uses: actions/download-artifact@v8
881+
with:
882+
pattern: android-apk
883+
merge-multiple: true
884+
path: android-apk
885+
886+
- name: Add nightly Android APK
887+
if: steps.android_apk.outcome == 'success'
888+
shell: bash
820889
run: |
821-
if [ -n "$GOOGLE_PLAY_SERVICE_ACCOUNT_JSON" ]; then
822-
node .github/scripts/mirror-play-apk.cjs
890+
shopt -s nullglob
891+
apks=(android-apk/*.apk)
892+
if [[ ${#apks[@]} -gt 0 ]]; then
893+
mv "${apks[@]}" release-assets/
823894
fi
824895
825896
# Installers verify archives against this file, so it is written from the

0 commit comments

Comments
 (0)