Skip to content

Commit dd452a4

Browse files
Fix nightly build workflow (bluesky-social#10943)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1a8ca71 commit dd452a4

2 files changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/build-submit-ios.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ on:
2424
type: boolean
2525
description: Assign the build to the "QA Team" TestFlight group after submitting
2626
default: false
27-
releaseNotes:
28-
type: string
29-
description: Notes to set as the TestFlight "What to Test" changelog
30-
required: false
31-
default: ''
3227
outputs:
3328
package-version:
3429
description: Version from package.json
@@ -216,7 +211,6 @@ jobs:
216211
# eas submit only uploads to App Store Connect; it can't assign a build to a
217212
# TestFlight group. fastlane's distribute_only mode skips the upload and assigns the
218213
# already-submitted build to the group, polling until Apple finishes processing it.
219-
# The "What to Test" changelog is supplied by the caller (e.g. the nightly workflow).
220214
- name: 🧪 Assign build to TestFlight group
221215
if: ${{ inputs.assignTestFlightGroup }}
222216
env:
@@ -225,26 +219,30 @@ jobs:
225219
ASC_KEY_P8_BASE64: ${{ secrets.ASC_KEY_P8_BASE64 }}
226220
APP_VERSION: ${{ steps.get-build-info.outputs.PACKAGE_VERSION }}
227221
BUILD_NUMBER: ${{ steps.ipa-build-number.outputs.build-number }}
228-
RELEASE_NOTES: ${{ inputs.releaseNotes }}
229222
run: |
230223
# Ensure the API key material is removed even if fastlane exits non-zero
231224
# (the step runs under `bash -e`, which would otherwise abort before cleanup).
232-
trap 'rm -f asc_api_key.p8 asc_api_key.json' EXIT
233-
echo "$ASC_KEY_P8_BASE64" | base64 --decode > asc_api_key.p8
234-
printf '{"key_id":"%s","issuer_id":"%s","key_filepath":"%s","in_house":false}' \
235-
"$ASC_KEY_ID" "$ASC_ISSUER_ID" "$PWD/asc_api_key.p8" > asc_api_key.json
236-
changelog_args=()
237-
if [ -n "$RELEASE_NOTES" ]; then
238-
changelog_args=(changelog:"$RELEASE_NOTES")
239-
fi
225+
trap 'rm -f asc_api_key.json' EXIT
226+
# fastlane's Token.from_json_file expects the .p8 contents inline under "key"
227+
# (PEM with embedded newlines), not a path. jq handles the newline escaping.
228+
key_content="$(echo "$ASC_KEY_P8_BASE64" | base64 --decode)"
229+
jq -n \
230+
--arg key_id "$ASC_KEY_ID" \
231+
--arg issuer_id "$ASC_ISSUER_ID" \
232+
--arg key "$key_content" \
233+
'{key_id: $key_id, issuer_id: $issuer_id, key: $key, in_house: false}' \
234+
> asc_api_key.json
235+
# app_platform is required in non-interactive mode: distribute_only otherwise
236+
# calls fetch_app_platform, which prompts for input and crashes without a TTY.
240237
fastlane run upload_to_testflight \
241238
api_key_path:"$PWD/asc_api_key.json" \
242239
distribute_only:true \
240+
app_platform:"ios" \
243241
app_identifier:"xyz.blueskyweb.app" \
244242
app_version:"$APP_VERSION" \
245243
build_number:"$BUILD_NUMBER" \
246-
"${changelog_args[@]}" \
247-
groups:"QA Team"
244+
groups:"QA Team" \
245+
notify_external_testers:true
248246
249247
- name: 🔔 Notify Slack of Production Build
250248
if: ${{ inputs.profile == 'production' }}

.github/workflows/nightly-build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
if [ -z "$notes" ]; then
6363
notes="Nightly build — no new commits since the last nightly."
6464
fi
65-
# Cap the whole changelog (TestFlight "What to Test" is limited to 4000 characters).
65+
# Cap the whole changelog to keep the Slack message a reasonable size.
6666
# head -c caps the combined stream; cut -c would only cap each line independently.
6767
notes=$(printf '%s' "$notes" | head -c 3900)
6868
{
@@ -78,12 +78,16 @@ jobs:
7878
with:
7979
profile: testflight
8080
assignTestFlightGroup: true
81-
releaseNotes: ${{ needs.prepare.outputs.notes }}
8281
secrets: inherit
8382

8483
android:
8584
name: Nightly Android Build
8685
needs: [prepare]
86+
# build-submit-android.yml contains an attachToRelease job that requests contents: write.
87+
# That job is skipped for nightly (it needs a production tag build), but GitHub statically
88+
# validates the reusable-workflow permission ceiling, so the caller must grant it here.
89+
permissions:
90+
contents: write
8791
uses: ./.github/workflows/build-submit-android.yml
8892
with:
8993
profile: testflight-android

0 commit comments

Comments
 (0)