name: TestFlight # Builds the iPhone app and uploads it to TestFlight (internal group "Jobley Internal"). # Same script as a local upload: scripts/release-ios.sh. See RELEASING.md for the secrets. on: workflow_dispatch: inputs: build: description: Build number (empty = one more than App Store Connect's newest) required: false permissions: contents: read concurrency: group: testflight cancel-in-progress: false jobs: upload: runs-on: xcode-27 timeout-minutes: 75 steps: - uses: actions/checkout@v5 with: ref: main - name: Select Xcode 27.2 run: sudo xcode-select -s /Applications/Xcode_27.2.app - name: Install XcodeGen run: brew list xcodegen >/dev/null 2>&1 || brew install xcodegen - name: Import the Apple Distribution certificate env: DISTRIBUTION_P12_BASE64: ${{ secrets.DISTRIBUTION_P12_BASE64 }} DISTRIBUTION_P12_PASSWORD: ${{ secrets.DISTRIBUTION_P12_PASSWORD }} run: | keychain="$RUNNER_TEMP/release.keychain-db" password="$(uuidgen)" security create-keychain -p "$password" "$keychain" security set-keychain-settings -lut 3600 "$keychain" security unlock-keychain -p "$password" "$keychain" echo "$DISTRIBUTION_P12_BASE64" | base64 --decode > "$RUNNER_TEMP/distribution.p12" security import "$RUNNER_TEMP/distribution.p12" -k "$keychain" -P "$DISTRIBUTION_P12_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain" > /dev/null security list-keychains -d user -s "$keychain" login.keychain-db rm "$RUNNER_TEMP/distribution.p12" - name: Write the App Store Connect upload key env: ASC_UPLOAD_KEY: ${{ secrets.ASC_UPLOAD_KEY }} run: | umask 077 printf '%s\n' "$ASC_UPLOAD_KEY" > "$RUNNER_TEMP/AuthKey.p8" - name: Upload env: JOBLEY_RELEASE_DIR: ${{ runner.temp }}/jobley-release APPLE_API_KEY_PATH: ${{ runner.temp }}/AuthKey.p8 APPLE_API_KEY_ID: ${{ secrets.ASC_UPLOAD_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.ASC_UPLOAD_ISSUER }} BUILD: ${{ inputs.build }} run: scripts/release-ios.sh ${BUILD:+--build "$BUILD"} - name: Remove signing material if: always() run: | security delete-keychain "$RUNNER_TEMP/release.keychain-db" || true rm -f "$RUNNER_TEMP/AuthKey.p8"