Graphley / app / commits / d80f63ae
App source: CI workflows new
written by Branchwell · d80f63aea8f10988b2fe7107ba87bf71b30173fb · parent d69ca9c4
2 files changed
.github/workflows/checks.yml added
| 1 | + name: Checks | |
| 2 | + on: | |
| 3 | + push: | |
| 4 | + branches: [main] | |
| 5 | + pull_request: | |
| 6 | + branches: [main] | |
| 7 | + permissions: | |
| 8 | + contents: read | |
| 9 | + concurrency: | |
| 10 | + group: checks-${{ github.ref }} | |
| 11 | + cancel-in-progress: true | |
| 12 | + jobs: | |
| 13 | + checks: | |
| 14 | + runs-on: xcode-27 | |
| 15 | + timeout-minutes: 30 | |
| 16 | + steps: | |
| 17 | + - uses: actions/checkout@v5 | |
| 18 | + - name: Select Xcode 27.2 | |
| 19 | + run: sudo xcode-select -s /Applications/Xcode_27.2.app | |
| 20 | + - name: Package tests | |
| 21 | + run: swift test | |
| 22 | + - name: Generate the Xcode project | |
| 23 | + run: brew list xcodegen >/dev/null 2>&1 || brew install xcodegen; xcodegen generate | |
| 24 | + - name: Build for Mac | |
| 25 | + run: | | |
| 26 | + set -o pipefail | |
| 27 | + xcodebuild -project Graphley.xcodeproj -scheme GraphleyMac -configuration Release \ | |
| 28 | + -destination 'generic/platform=macOS' CODE_SIGNING_ALLOWED=NO build | grep -E "error:|BUILD" | |
| 29 | + - name: Build for iPhone | |
| 30 | + run: | | |
| 31 | + set -o pipefail | |
| 32 | + xcodebuild -project Graphley.xcodeproj -scheme GraphleyPhone -configuration Release \ | |
| 33 | + -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO build | grep -E "error:|BUILD" |
.github/workflows/testflight.yml added
| 1 | + name: 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. | |
| 4 | + on: | |
| 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 | |
| 15 | + permissions: | |
| 16 | + contents: read | |
| 17 | + concurrency: | |
| 18 | + group: testflight | |
| 19 | + cancel-in-progress: false | |
| 20 | + jobs: | |
| 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" |