Fix nightly build workflow (#10943)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Eric Bailey
2026-06-18 10:13:41 -05:00
committed by GitHub
parent 1a8ca710ee
commit dd452a4336
2 changed files with 21 additions and 19 deletions
+15 -17
View File
@@ -24,11 +24,6 @@ on:
type: boolean type: boolean
description: Assign the build to the "QA Team" TestFlight group after submitting description: Assign the build to the "QA Team" TestFlight group after submitting
default: false default: false
releaseNotes:
type: string
description: Notes to set as the TestFlight "What to Test" changelog
required: false
default: ''
outputs: outputs:
package-version: package-version:
description: Version from package.json description: Version from package.json
@@ -216,7 +211,6 @@ jobs:
# eas submit only uploads to App Store Connect; it can't assign a build to a # eas submit only uploads to App Store Connect; it can't assign a build to a
# TestFlight group. fastlane's distribute_only mode skips the upload and assigns the # TestFlight group. fastlane's distribute_only mode skips the upload and assigns the
# already-submitted build to the group, polling until Apple finishes processing it. # already-submitted build to the group, polling until Apple finishes processing it.
# The "What to Test" changelog is supplied by the caller (e.g. the nightly workflow).
- name: 🧪 Assign build to TestFlight group - name: 🧪 Assign build to TestFlight group
if: ${{ inputs.assignTestFlightGroup }} if: ${{ inputs.assignTestFlightGroup }}
env: env:
@@ -225,26 +219,30 @@ jobs:
ASC_KEY_P8_BASE64: ${{ secrets.ASC_KEY_P8_BASE64 }} ASC_KEY_P8_BASE64: ${{ secrets.ASC_KEY_P8_BASE64 }}
APP_VERSION: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }} APP_VERSION: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}
BUILD_NUMBER: ${{ steps.ipa-build-number.outputs.build-number }} BUILD_NUMBER: ${{ steps.ipa-build-number.outputs.build-number }}
RELEASE_NOTES: ${{ inputs.releaseNotes }}
run: | run: |
# Ensure the API key material is removed even if fastlane exits non-zero # Ensure the API key material is removed even if fastlane exits non-zero
# (the step runs under `bash -e`, which would otherwise abort before cleanup). # (the step runs under `bash -e`, which would otherwise abort before cleanup).
trap 'rm -f asc_api_key.p8 asc_api_key.json' EXIT trap 'rm -f asc_api_key.json' EXIT
echo "$ASC_KEY_P8_BASE64" | base64 --decode > asc_api_key.p8 # fastlane's Token.from_json_file expects the .p8 contents inline under "key"
printf '{"key_id":"%s","issuer_id":"%s","key_filepath":"%s","in_house":false}' \ # (PEM with embedded newlines), not a path. jq handles the newline escaping.
"$ASC_KEY_ID" "$ASC_ISSUER_ID" "$PWD/asc_api_key.p8" > asc_api_key.json key_content="$(echo "$ASC_KEY_P8_BASE64" | base64 --decode)"
changelog_args=() jq -n \
if [ -n "$RELEASE_NOTES" ]; then --arg key_id "$ASC_KEY_ID" \
changelog_args=(changelog:"$RELEASE_NOTES") --arg issuer_id "$ASC_ISSUER_ID" \
fi --arg key "$key_content" \
'{key_id: $key_id, issuer_id: $issuer_id, key: $key, in_house: false}' \
> asc_api_key.json
# app_platform is required in non-interactive mode: distribute_only otherwise
# calls fetch_app_platform, which prompts for input and crashes without a TTY.
fastlane run upload_to_testflight \ fastlane run upload_to_testflight \
api_key_path:"$PWD/asc_api_key.json" \ api_key_path:"$PWD/asc_api_key.json" \
distribute_only:true \ distribute_only:true \
app_platform:"ios" \
app_identifier:"xyz.blueskyweb.app" \ app_identifier:"xyz.blueskyweb.app" \
app_version:"$APP_VERSION" \ app_version:"$APP_VERSION" \
build_number:"$BUILD_NUMBER" \ build_number:"$BUILD_NUMBER" \
"${changelog_args[@]}" \ groups:"QA Team" \
groups:"QA Team" notify_external_testers:true
- name: 🔔 Notify Slack of Production Build - name: 🔔 Notify Slack of Production Build
if: ${{ inputs.profile == 'production' }} if: ${{ inputs.profile == 'production' }}
+6 -2
View File
@@ -62,7 +62,7 @@ jobs:
if [ -z "$notes" ]; then if [ -z "$notes" ]; then
notes="Nightly build — no new commits since the last nightly." notes="Nightly build — no new commits since the last nightly."
fi fi
# Cap the whole changelog (TestFlight "What to Test" is limited to 4000 characters). # Cap the whole changelog to keep the Slack message a reasonable size.
# head -c caps the combined stream; cut -c would only cap each line independently. # head -c caps the combined stream; cut -c would only cap each line independently.
notes=$(printf '%s' "$notes" | head -c 3900) notes=$(printf '%s' "$notes" | head -c 3900)
{ {
@@ -78,12 +78,16 @@ jobs:
with: with:
profile: testflight profile: testflight
assignTestFlightGroup: true assignTestFlightGroup: true
releaseNotes: ${{ needs.prepare.outputs.notes }}
secrets: inherit secrets: inherit
android: android:
name: Nightly Android Build name: Nightly Android Build
needs: [prepare] needs: [prepare]
# build-submit-android.yml contains an attachToRelease job that requests contents: write.
# That job is skipped for nightly (it needs a production tag build), but GitHub statically
# validates the reusable-workflow permission ceiling, so the caller must grant it here.
permissions:
contents: write
uses: ./.github/workflows/build-submit-android.yml uses: ./.github/workflows/build-submit-android.yml
with: with:
profile: testflight-android profile: testflight-android