Branchwell

Graphley / app · graphley.ai / .github / workflows / testflight.yml

Raw 2.8 KB on d80f63aea8f10988b2fe7107ba87bf71b30173fb
1name: TestFlight
2# Upload only after auditing TestFlight groups and automatic distribution; assign the owner manually.
3# Same script as a local upload: scripts/release-ios.sh. See RELEASING.md for the secrets.
4on:
5 workflow_dispatch:
6 inputs:
7 owner_audience_verified:
8 description: I verified the owner is the only recipient and disabled legacy auto-distribution
9 required: true
10 type: boolean
11 default: false
12 build:
13 description: Build number (empty = one more than App Store Connect's newest)
14 required: false
15permissions:
16 contents: read
17concurrency:
18 group: testflight
19 cancel-in-progress: false
20jobs:
21 upload:
22 if: inputs.owner_audience_verified == true
23 runs-on: xcode-27
24 timeout-minutes: 75
25 steps:
26 - uses: actions/checkout@v5
27 with:
28 ref: main
29 - name: Select Xcode 27.2
30 run: sudo xcode-select -s /Applications/Xcode_27.2.app
31 - name: Install XcodeGen
32 run: brew list xcodegen >/dev/null 2>&1 || brew install xcodegen
33 - name: Import the Apple Distribution certificate
34 env:
35 DISTRIBUTION_P12_BASE64: ${{ secrets.DISTRIBUTION_P12_BASE64 }}
36 DISTRIBUTION_P12_PASSWORD: ${{ secrets.DISTRIBUTION_P12_PASSWORD }}
37 run: |
38 keychain="$RUNNER_TEMP/release.keychain-db"
39 password="$(uuidgen)"
40 security create-keychain -p "$password" "$keychain"
41 security set-keychain-settings -lut 3600 "$keychain"
42 security unlock-keychain -p "$password" "$keychain"
43 echo "$DISTRIBUTION_P12_BASE64" | base64 --decode > "$RUNNER_TEMP/distribution.p12"
44 security import "$RUNNER_TEMP/distribution.p12" -k "$keychain" -P "$DISTRIBUTION_P12_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
45 security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain" > /dev/null
46 security list-keychains -d user -s "$keychain" login.keychain-db
47 rm "$RUNNER_TEMP/distribution.p12"
48 - name: Write the App Store Connect upload key
49 env:
50 ASC_UPLOAD_KEY: ${{ secrets.ASC_UPLOAD_KEY }}
51 run: |
52 umask 077
53 printf '%s\n' "$ASC_UPLOAD_KEY" > "$RUNNER_TEMP/AuthKey.p8"
54 - name: Upload
55 env:
56 GRAPHLEY_OWNER_TESTFLIGHT_VERIFIED: "1"
57 GRAPHLEY_RELEASE_DIR: ${{ runner.temp }}/graphley-release
58 APPLE_API_KEY_PATH: ${{ runner.temp }}/AuthKey.p8
59 APPLE_API_KEY_ID: ${{ secrets.ASC_UPLOAD_KEY_ID }}
60 APPLE_API_ISSUER: ${{ secrets.ASC_UPLOAD_ISSUER }}
61 BUILD: ${{ inputs.build }}
62 run: scripts/release-ios.sh ${BUILD:+--build "$BUILD"}
63 - name: Remove signing material
64 if: always()
65 run: |
66 security delete-keychain "$RUNNER_TEMP/release.keychain-db" || true
67 rm -f "$RUNNER_TEMP/AuthKey.p8"