Jobley / app · jobley.ai / .github / workflows / mac-release.yml
| 1 | name: Mac release |
| 2 | # Builds, signs, notarizes and publishes a Mac release from the cloud: the DMG and Sparkle appcast go to |
| 3 | # protomota/jobley-site main, which Vercel deploys to jobley.ai. Same script as a local release: |
| 4 | # scripts/release-mac.sh. See RELEASING.md for the secrets. |
| 5 | on: |
| 6 | workflow_dispatch: |
| 7 | inputs: |
| 8 | version: |
| 9 | description: Version to release, for example 0.1.1 |
| 10 | required: true |
| 11 | notes: |
| 12 | description: What changed (shown in the update window) |
| 13 | default: Bug fixes and improvements. |
| 14 | permissions: |
| 15 | contents: write |
| 16 | concurrency: |
| 17 | group: mac-release |
| 18 | cancel-in-progress: false |
| 19 | jobs: |
| 20 | release: |
| 21 | runs-on: xcode-27 |
| 22 | timeout-minutes: 60 |
| 23 | steps: |
| 24 | - uses: actions/checkout@v5 |
| 25 | with: |
| 26 | ref: main |
| 27 | - uses: actions/checkout@v5 |
| 28 | with: |
| 29 | repository: protomota/jobley-site |
| 30 | ref: main |
| 31 | path: site |
| 32 | token: ${{ secrets.SITE_REPO_TOKEN }} |
| 33 | - name: Select Xcode 27.2 |
| 34 | run: sudo xcode-select -s /Applications/Xcode_27.2.app |
| 35 | - name: Install XcodeGen |
| 36 | run: brew list xcodegen >/dev/null 2>&1 || brew install xcodegen |
| 37 | - name: Import the Developer ID certificate |
| 38 | env: |
| 39 | DEVELOPER_ID_P12_BASE64: ${{ secrets.DEVELOPER_ID_P12_BASE64 }} |
| 40 | DEVELOPER_ID_P12_PASSWORD: ${{ secrets.DEVELOPER_ID_P12_PASSWORD }} |
| 41 | run: | |
| 42 | keychain="$RUNNER_TEMP/release.keychain-db" |
| 43 | password="$(uuidgen)" |
| 44 | security create-keychain -p "$password" "$keychain" |
| 45 | security set-keychain-settings -lut 3600 "$keychain" |
| 46 | security unlock-keychain -p "$password" "$keychain" |
| 47 | echo "$DEVELOPER_ID_P12_BASE64" | base64 --decode > "$RUNNER_TEMP/developer-id.p12" |
| 48 | security import "$RUNNER_TEMP/developer-id.p12" -k "$keychain" -P "$DEVELOPER_ID_P12_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security |
| 49 | security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain" > /dev/null |
| 50 | security list-keychains -d user -s "$keychain" login.keychain-db |
| 51 | rm "$RUNNER_TEMP/developer-id.p12" |
| 52 | - name: Write the Apple API key |
| 53 | env: |
| 54 | APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} |
| 55 | run: | |
| 56 | umask 077 |
| 57 | printf '%s' "$APPLE_API_KEY" > "$RUNNER_TEMP/AuthKey.p8" |
| 58 | - name: Release |
| 59 | env: |
| 60 | JOBLEY_RELEASE_DIR: ${{ runner.temp }}/jobley-release |
| 61 | JOBLEY_SITE_DIR: ${{ github.workspace }}/site |
| 62 | APPLE_API_KEY_PATH: ${{ runner.temp }}/AuthKey.p8 |
| 63 | APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} |
| 64 | APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} |
| 65 | JOBLEY_SPARKLE_EDDSA_PRIVATE_KEY: ${{ secrets.JOBLEY_SPARKLE_EDDSA_PRIVATE_KEY }} |
| 66 | RELEASE_VERSION: ${{ inputs.version }} |
| 67 | RELEASE_NOTES: ${{ inputs.notes }} |
| 68 | run: | |
| 69 | for repo in . site; do |
| 70 | git -C "$repo" config user.name "github-actions[bot]" |
| 71 | git -C "$repo" config user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 72 | done |
| 73 | scripts/release-mac.sh "$RELEASE_VERSION" --notes "$RELEASE_NOTES" --publish |
| 74 | - name: Remove signing material |
| 75 | if: always() |
| 76 | run: | |
| 77 | security delete-keychain "$RUNNER_TEMP/release.keychain-db" || true |
| 78 | rm -f "$RUNNER_TEMP/AuthKey.p8" |