name: Release run-name: Release ${{ inputs.tag }} 'on': workflow_dispatch: inputs: tag: description: Release tag already mirrored from default-branch history required: true type: string permissions: contents: read concurrency: group: release-publication cancel-in-progress: false env: RELEASE_TAG: ${{ inputs.tag }} jobs: preflight: name: Release provenance if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) runs-on: macos-15 timeout-minutes: 5 outputs: trusted: ${{ steps.release.outputs.trusted }} commit: ${{ steps.release.outputs.commit }} artifact: ${{ steps.release.outputs.artifact }} directory: ${{ steps.release.outputs.directory }} cask: ${{ steps.release.outputs.cask }} steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 persist-credentials: false - id: release name: Show provenance and enforce release ordering before approval env: GH_TOKEN: ${{ github.token }} run: Scripts/ci-release.sh preflight checks: needs: preflight if: needs.preflight.outputs.trusted == 'true' uses: ./.github/workflows/ci.yml with: ref: ${{ needs.preflight.outputs.commit }} build: name: Unsigned release build needs: [preflight, checks] if: needs.preflight.outputs.trusted == 'true' runs-on: macos-15 timeout-minutes: 60 env: RELEASE_COMMIT: ${{ needs.preflight.outputs.commit }} RELEASE_SOURCE: ${{ github.workspace }}/source steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 persist-credentials: false - name: Check out release source without changing trusted scripts uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: ref: ${{ needs.preflight.outputs.commit }} path: source persist-credentials: false - name: Require the tested release toolchain run: | cmp .xcode-version source/.xcode-version || { printf 'Release source must use the trusted Xcode pin.\n' >&2; exit 1; } - name: Select pinned Xcode run: | read -r xcode < .xcode-version [[ $xcode =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] || { printf 'Invalid Xcode version: %s\n' "$xcode" >&2; exit 1; } sudo xcode-select --switch "/Applications/Xcode_${xcode}.app/Contents/Developer" - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3 env: MISE_OFFLINE: 'false' with: version: '2026.6.10' cache: false - run: mise run doctor - name: Package the universal app without release secrets run: Scripts/ci-release.sh build - name: Save unsigned app for the isolated signing job uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: unsigned-app overwrite: true path: build/unsigned/app.tar.gz if-no-files-found: error retention-days: 1 release: name: Approved signing and publication needs: [preflight, checks, build] if: needs.preflight.outputs.trusted == 'true' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) environment: release runs-on: macos-15 timeout-minutes: 30 env: RELEASE_COMMIT: ${{ needs.preflight.outputs.commit }} permissions: contents: write # Publish only after the owner-reviewed release environment gate. steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: ref: ${{ github.event.repository.default_branch }} fetch-depth: 0 persist-credentials: false - name: Select pinned Xcode run: | read -r xcode < .xcode-version [[ $xcode =~ ^[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] || { printf 'Invalid Xcode version: %s\n' "$xcode" >&2; exit 1; } sudo xcode-select --switch "/Applications/Xcode_${xcode}.app/Contents/Developer" - uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3 env: MISE_OFFLINE: 'false' with: version: '2026.6.10' cache: false - run: mise run doctor - name: Download only the unsigned app archive uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: unsigned-app path: build/unsigned - name: Sign, notarize, staple, and sign the update using trusted scripts env: DEVELOPER_ID_P12: ${{ secrets.DEVELOPER_ID_P12 }} DEVELOPER_ID_PASSWORD: ${{ secrets.DEVELOPER_ID_PASSWORD }} DEVELOPER_ID_IDENTITY: ${{ secrets.DEVELOPER_ID_IDENTITY }} APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} ASC_PRIVATE_KEY: ${{ secrets.ASC_PRIVATE_KEY }} ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }} run: Scripts/ci-release.sh sign - name: Save the signed installer, checksums, appcast, and cask uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ needs.preflight.outputs.artifact }} overwrite: true compression-level: 0 # The installer is already compressed. path: | ${{ needs.preflight.outputs.directory }}/*.dmg ${{ needs.preflight.outputs.directory }}/SHA256SUMS ${{ needs.preflight.outputs.directory }}/appcast.xml ${{ needs.preflight.outputs.directory }}/${{ needs.preflight.outputs.cask }}.rb if-no-files-found: error retention-days: 30 - name: Publish the DMG, checksums, and release metadata, resuming drafts only env: GH_TOKEN: ${{ github.token }} run: Scripts/ci-release.sh publish