Repository navigation
Release v1.2.4 #3008
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Desktop macOS signing | |
| # The Mac counterpart of `desktop-signing.yml`, and deliberately the same shape: a credential-free | |
| # job that runs on every change, and a signing job behind a protected environment that an ordinary | |
| # pull request cannot reach. What differs is what the signature buys. On Windows an unsigned build | |
| # collects a SmartScreen warning; on macOS an ad-hoc signed build is refused outright, and the only | |
| # way in is Finder's "Open Anyway", which is a thing nobody should be taught to do to install a | |
| # product. So this job is also the only place Mac updater artifacts are produced: an update the app | |
| # installs by itself has to be one Gatekeeper would have accepted had a person downloaded it. (The | |
| # Windows updater installs the signed installer itself; Desktop Windows signing signs it for the | |
| # updater with this environment's key, in a job of its own.) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| signing-mode: | |
| description: Opt in to signing with the protected Developer ID certificate | |
| type: choice | |
| options: [none, developer-id] | |
| default: none | |
| required: true | |
| release-tag: | |
| description: Attach the signed artifacts and latest.json to this existing release | |
| type: string | |
| default: "" | |
| required: false | |
| # publish-release.yml says whether the release becomes Latest. A stable release is published | |
| # not Latest, and becomes Latest once both this and Desktop Windows signing have attached their | |
| # signed installers, in whichever finishes second. Signing a release again by hand leaves | |
| # Latest where it is unless this is set. | |
| make-latest: | |
| description: Mark the release Latest once every signed installer is attached, unless a newer release already is | |
| type: boolean | |
| default: false | |
| required: false | |
| # Pull requests and pushes to main run only the credential-free checks; the signing job's `if` | |
| # admits a `v*` tag or an explicit dispatch and nothing else, so no pull request reaches the | |
| # environment. | |
| pull_request: | |
| paths: | |
| - desktop/** | |
| - package.json | |
| - .github/workflows/desktop-macos-signing.yml | |
| - .github/workflows/publish-release.yml | |
| - .github/workflows/desktop-build.yml | |
| - .github/workflows/desktop-signing.yml | |
| - scripts/release-* | |
| - scripts/downloads-* | |
| - .github/workflows/downloads-sync.yml | |
| - docs/releasing.md | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| paths: | |
| - desktop/** | |
| - package.json | |
| - .github/workflows/desktop-macos-signing.yml | |
| - .github/workflows/publish-release.yml | |
| - .github/workflows/desktop-build.yml | |
| - .github/workflows/desktop-signing.yml | |
| - scripts/release-* | |
| - scripts/downloads-* | |
| - .github/workflows/downloads-sync.yml | |
| - docs/releasing.md | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: desktop-macos-signing-${{ github.ref }} | |
| # A pull request's newer push replaces its dry run, freeing a macOS runner. Signing runs (tags, | |
| # main, dispatch) never cancel. | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| # Everything about the updater that can be checked without a certificate, checked on every push. | |
| # The wiring is four files that have to agree — the plugin in Cargo.toml, the plugin registered in | |
| # main.rs, the permissions in the capability, and the endpoint and public key in the signing | |
| # overlay — and three of the four fail silently at runtime rather than at build time if they drift | |
| # apart. | |
| checks: | |
| name: Updater regressions (no Apple access) | |
| runs-on: macos-15 | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - run: bun run typecheck | |
| working-directory: desktop | |
| - name: Update offer regressions | |
| run: bun test src/UpdateOffer.test.tsx | |
| working-directory: desktop | |
| # minisign checks the Windows installer's updater signature in Desktop Windows signing, and | |
| # the test of that script needs it here, where it must run rather than skip. | |
| - name: Install minisign | |
| env: | |
| HOMEBREW_NO_AUTO_UPDATE: "1" | |
| HOMEBREW_NO_INSTALL_CLEANUP: "1" | |
| run: brew install minisign | |
| # What a release signs and attaches: a candidate pinned to its own images with no updater, | |
| # a stable release made Latest only once its signed Mac and Windows installers are both on | |
| # it and both listed in one latest.json, the Windows installer signed for the updater with | |
| # the key its app trusts, every signed installer under its fixed download name too, and | |
| # downloads.copilotkit.ai | |
| # serving only the Latest stable release's signed installers. And every signed build carries | |
| # the Intelligence CLI, its Mac binaries signed for notarization: an app without it cannot set | |
| # up Intelligence, and the updater would put it on every Mac. And each Mac app, the Intel one | |
| # built on this Apple silicon runner included, is its own architecture all the way down. And | |
| # stapling and validating the ticket, Tauri's own staple of the .app included, try a dropped | |
| # connection to Apple again, which failed v0.3.3's signing run three times, and fail at once | |
| # on a file with no ticket. And the 1Password helper is built, signed and checked as notarization | |
| # requires; those tests need a Mac, so they run here or nowhere. | |
| - name: Signed release regressions | |
| env: | |
| OPENBOT_REQUIRE_MINISIGN: "1" | |
| run: >- | |
| bun test scripts/signed-build.test.ts scripts/publish-signed-mac.test.ts | |
| scripts/publish-signed-windows.test.ts scripts/signing-workflows.test.ts | |
| scripts/sign-windows-update.test.ts | |
| ../scripts/release-latest.test.ts ../scripts/release-download-names.test.ts | |
| ../scripts/downloads-sync.test.ts ../scripts/release-older-installers.test.ts | |
| scripts/release-cli-bundle.test.ts | |
| scripts/verify-mac-arch.test.ts scripts/staple-with-retry.test.ts | |
| scripts/release-onepassword-helper.test.ts scripts/onepassword-helper.test.ts | |
| working-directory: desktop | |
| - name: Importing the Developer ID intermediate twice succeeds | |
| # The first real signing run stopped here: the .p12 already carried the intermediate, and a | |
| # second import failed. The signing job runs this script on a keychain that may hold it. | |
| run: | | |
| set -euo pipefail | |
| keychain="$RUNNER_TEMP/intermediate-check.keychain-db" | |
| security create-keychain -p check "$keychain" | |
| trap 'security delete-keychain "$keychain"' EXIT | |
| desktop/scripts/import-developer-id-intermediate.sh "$keychain" | |
| desktop/scripts/import-developer-id-intermediate.sh "$keychain" | |
| security find-certificate -c "Developer ID Certification Authority" "$keychain" > /dev/null | |
| - name: Check the updater is wired together | |
| run: | | |
| set -euo pipefail | |
| config=desktop/src-tauri/tauri.conf.json | |
| overlay=desktop/src-tauri/tauri.macos-signing.conf.json | |
| test "$(jq -r '.bundle.createUpdaterArtifacts' "$overlay")" = 'true' | |
| # And nowhere else. Tauri refuses to finish any bundle that asks for updater artifacts | |
| # without `TAURI_SIGNING_PRIVATE_KEY`, so this setting in the base config breaks ordinary | |
| # desktop CI and the local build in docs/releasing.md on all three platforms. | |
| test "$(jq -r '.bundle.createUpdaterArtifacts // false' "$config")" = 'false' | |
| # The updater lives in the overlay too. main.rs registers the plugin only when the config | |
| # carries `plugins.updater`, so every build without the overlay (desktop CI, local, the | |
| # unsigned release installers) has no updater to offer an update it would then refuse. | |
| test "$(jq -r '.plugins.updater // empty' "$config")" = '' | |
| # The apps read downloads.copilotkit.ai, the same file the update banner reads, and fall | |
| # back to the GitHub release it mirrors only when that address does not answer. | |
| test "$(jq -r '.plugins.updater.endpoints | join(" ")' "$overlay")" \ | |
| = 'https://downloads.copilotkit.ai/latest/latest.json https://github.com/CopilotKit/OpenBot/releases/latest/download/latest.json' | |
| test "$(jq -r '.plugins.updater.pubkey | length > 0' "$overlay")" = 'true' | |
| grep -q 'tauri-plugin-updater' desktop/src-tauri/Cargo.toml | |
| grep -q 'tauri_plugin_updater::Builder::new().build()' desktop/src-tauri/src/main.rs | |
| grep -q 'contains_key("updater")' desktop/src-tauri/src/main.rs | |
| # The shell reads the feed and installs; the setup window and OpenBot's page only ask it. | |
| # No page is granted the updater itself. | |
| grep -q 'watch_for_app_updates(app.handle())' desktop/src-tauri/src/main.rs | |
| grep -q 'install_app_update' desktop/src-tauri/src/main.rs | |
| # A signed Windows app has the same updater: the same key, the same feed, in the Windows | |
| # signing overlay. Not `createUpdaterArtifacts`, which would need the updater key in | |
| # `windows-signing`; the installer is signed for the updater by its own job there. | |
| windows=desktop/src-tauri/tauri.windows-signing.conf.json | |
| test "$(jq -c '.plugins.updater | del(.windows)' "$windows")" \ | |
| = "$(jq -c '.plugins.updater' "$overlay")" | |
| test "$(jq -r '.plugins.updater.windows.installMode' "$windows")" = 'passive' | |
| test "$(jq -r '.bundle.createUpdaterArtifacts // false' "$windows")" = 'false' | |
| # On Windows the updater runs the installer and exits the app at once, so OpenBot is | |
| # stopped just before, in the updater's on_before_exit, not after the install. | |
| grep -q '.on_before_exit(' desktop/src-tauri/src/main.rs | |
| grep -q 'stop_before_installer(&handle)' desktop/src-tauri/src/main.rs | |
| if jq -e '.permissions | index("updater:default")' \ | |
| desktop/src-tauri/capabilities/default.json > /dev/null; then | |
| echo '::error::No window needs the updater plugin; the shell drives it.' | |
| exit 1 | |
| fi | |
| echo 'Updater wiring is consistent across Cargo.toml, main.rs, the capability and both signing overlays.' | |
| # Both architectures on the Apple silicon runner, the Intel one built for `x86_64-apple-darwin` as | |
| # Tauri documents (signed-build.ts names the target, and assembles the CLI and its Node runtime for | |
| # it). The Intel runner took twice as long for the same build. Each produces its own signed, | |
| # notarized, stapled .app and .dmg, and, for a build that is not pinned, the updater archive, and | |
| # each is checked to be its own architecture all the way down (verify-mac-arch.sh), so an Intel | |
| # app with an Apple silicon binary in it never ships. | |
| sign: | |
| name: Sign and notarize (${{ matrix.platform.target }}) | |
| needs: checks | |
| if: >- | |
| (github.event_name == 'workflow_dispatch' && inputs.signing-mode == 'developer-id') || | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | |
| environment: macos-signing | |
| runs-on: ${{ matrix.platform.runner }} | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - runner: macos-15 | |
| target: darwin-aarch64 | |
| arch: arm64 | |
| rust-target: aarch64-apple-darwin | |
| lipo-arch: arm64 | |
| - runner: macos-15 | |
| target: darwin-x86_64 | |
| arch: x64 | |
| rust-target: x86_64-apple-darwin | |
| lipo-arch: x86_64 | |
| env: | |
| SIGNING_SOURCE_SHA: ${{ github.sha }} | |
| # Where Tauri leaves a build that names its Rust target, as signed-build.ts makes every Mac | |
| # build do. | |
| BUNDLE: desktop/src-tauri/target/${{ matrix.platform.rust-target }}/release/bundle | |
| steps: | |
| # The whole history: an internal build is numbered by its commit count (desktop-version.ts). | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.sha }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check signing configuration | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
| APPLE_API_KEY_P8: ${{ secrets.APPLE_API_KEY_P8 }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| run: | | |
| set -euo pipefail | |
| for name in APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY \ | |
| APPLE_API_ISSUER APPLE_API_KEY APPLE_API_KEY_P8 TAURI_SIGNING_PRIVATE_KEY; do | |
| if [ -z "${!name:-}" ]; then | |
| echo "::error::Missing macos-signing secret: $name" | |
| exit 1 | |
| fi | |
| done | |
| test "$(git rev-parse HEAD)" = "$SIGNING_SOURCE_SHA" | |
| # The placeholder shipped with the pull request that added this lane. An app built with it | |
| # installs nothing: every update it is offered fails signature verification. Refusing here | |
| # is the difference between noticing on the first signing run and noticing in the field. | |
| pubkey="$(jq -r '.plugins.updater.pubkey' desktop/src-tauri/tauri.macos-signing.conf.json)" | |
| if [ "$pubkey" = 'REPLACE_WITH_UPDATER_PUBKEY' ]; then | |
| echo '::error::tauri.macos-signing.conf.json still holds the updater public key placeholder.' | |
| exit 1 | |
| fi | |
| - name: Import the Developer ID certificate into a temporary keychain | |
| env: | |
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| run: | | |
| set -euo pipefail | |
| keychain="$RUNNER_TEMP/openbot-signing.keychain-db" | |
| password="$(openssl rand -base64 24)" | |
| echo "::add-mask::$password" | |
| echo "SIGNING_KEYCHAIN=$keychain" >> "$GITHUB_ENV" | |
| echo "SIGNING_KEYCHAIN_PASSWORD=$password" >> "$GITHUB_ENV" | |
| security create-keychain -p "$password" "$keychain" | |
| # The runner's login keychain relocks on a timer and takes codesign's key access with it. | |
| security set-keychain-settings -lut 7200 "$keychain" | |
| security unlock-keychain -p "$password" "$keychain" | |
| certificate="$RUNNER_TEMP/developer-id.p12" | |
| printf '%s' "$APPLE_CERTIFICATE" | base64 --decode > "$certificate" | |
| security import "$certificate" -k "$keychain" -P "$APPLE_CERTIFICATE_PASSWORD" \ | |
| -T /usr/bin/codesign -T /usr/bin/security -f pkcs12 | |
| rm -f "$certificate" | |
| # The leaf alone does not chain to a root the runner trusts; see the script for why it | |
| # imports the G2 intermediate only when the .p12 did not already bring it. | |
| desktop/scripts/import-developer-id-intermediate.sh "$keychain" | |
| # Without this codesign stops for a UI prompt that a runner has nobody to answer. | |
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$password" "$keychain" | |
| existing=() | |
| while IFS= read -r line; do | |
| existing+=("$(echo "$line" | tr -d '" ')") | |
| done < <(security list-keychains -d user) | |
| security list-keychains -d user -s "$keychain" "${existing[@]}" | |
| security find-identity -v -p codesigning "$keychain" | |
| - name: Write the App Store Connect key | |
| env: | |
| APPLE_API_KEY_P8: ${{ secrets.APPLE_API_KEY_P8 }} | |
| run: | | |
| set -euo pipefail | |
| key="$RUNNER_TEMP/AuthKey.p8" | |
| umask 077 | |
| printf '%s' "$APPLE_API_KEY_P8" > "$key" | |
| echo "APPLE_API_KEY_PATH=$key" >> "$GITHUB_ENV" | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| # No caches in this job, Rust or Bun: it runs on release tags, and a signed, notarized build | |
| # must come from the tree and the lockfiles, not from anything an earlier run left behind. | |
| # The standard library for the architecture this job builds, which on the Apple silicon | |
| # runner is a second target for the Intel build. | |
| - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 | |
| with: | |
| toolchain: stable | |
| targets: ${{ matrix.platform.rust-target }} | |
| # Go builds the 1Password helper (desktop/scripts/onepassword-helper.ts), the Intel one | |
| # cross-built with Xcode's clang. The exact release, and no cache, by the rule above. | |
| - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 | |
| with: | |
| go-version: 1.26.11 | |
| cache: false | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - run: bun run typecheck | |
| working-directory: desktop | |
| - name: Prepare the build version | |
| run: | | |
| set -euo pipefail | |
| if [ "${GITHUB_REF_TYPE}" = 'tag' ]; then | |
| bun desktop/scripts/desktop-version.ts release | |
| else | |
| bun desktop/scripts/desktop-version.ts internal | |
| fi | |
| cat desktop/build-version.json | |
| # The overlay carries `createUpdaterArtifacts` and the `app, dmg` targets, and only this job | |
| # passes it. The .dmg is what a person downloads and the .app is what becomes the | |
| # `.app.tar.gz` the updater installs; asking for the dmg alone would leave no .app to verify, | |
| # because Tauri deletes it once the image is written. | |
| # | |
| # signed-build.ts builds what desktop-build.yml built for the same release: a candidate or | |
| # beta pinned to its release's images and with no updater, and the CLI whenever the tree can | |
| # bundle one. This signed .dmg replaces the ad-hoc one on the release, so it must be the same | |
| # product. `updater` says whether this build made an updater archive. | |
| - name: Build, sign and notarize | |
| id: build | |
| env: | |
| ARCH: ${{ matrix.platform.arch }} | |
| # To read the release's container-images.json when this build is a candidate. | |
| GH_TOKEN: ${{ github.token }} | |
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| # Tauri staples the .app with xcrun, ignores a failure, and builds the disk image and the | |
| # updater archive from it straight after. The xcrun first on PATH here staples through | |
| # staple-with-retry.sh, so a dropped connection is tried again before either is built, and | |
| # passes every other call to the real xcrun (desktop/scripts/xcrun-staple-retry/xcrun). | |
| run: | | |
| set -euo pipefail | |
| export PATH="$PWD/desktop/scripts/xcrun-staple-retry:$PATH" | |
| export STAPLE_LOG="$RUNNER_TEMP/tauri-staple.log" | |
| : > "$STAPLE_LOG" | |
| bun desktop/scripts/signed-build.ts darwin "$ARCH" src-tauri/tauri.macos-signing.conf.json | |
| if [ -s "$STAPLE_LOG" ]; then | |
| echo "Tauri's staple of the .app, which it does not print:" | |
| cat "$STAPLE_LOG" | |
| else | |
| echo "::warning::Tauri did not staple the .app through xcrun-staple-retry, so a dropped connection there is not tried again." | |
| fi | |
| # Tauri notarizes and staples the .app (through the retry above). The disk image is assembled | |
| # afterwards, so it is submitted here rather than assumed: a stapled image is the one that | |
| # installs on a machine that is offline or behind a proxy Apple's notary service cannot be | |
| # reached through. | |
| - name: Notarize and staple the disk image | |
| env: | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} | |
| run: | | |
| set -euo pipefail | |
| images=("$BUNDLE"/dmg/*.dmg) | |
| test "${#images[@]}" -eq 1 | |
| xcrun notarytool submit "${images[0]}" \ | |
| --key "$APPLE_API_KEY_PATH" --key-id "$APPLE_API_KEY" --issuer "$APPLE_API_ISSUER" \ | |
| --wait --timeout 30m | |
| # Apple has accepted it by now; stapling only fetches the ticket, and retries a dropped | |
| # connection rather than failing a notarized build (see the script). | |
| desktop/scripts/staple-with-retry.sh "${images[0]}" | |
| - name: Verify the signature, Gatekeeper and the notarization ticket | |
| run: | | |
| set -euo pipefail | |
| app="$BUNDLE/macos/OpenBot.app" | |
| images=("$BUNDLE"/dmg/*.dmg) | |
| # What the RED case fails. An ad-hoc build passes none of these three. Validating the | |
| # ticket asks Apple's CloudKit, and retries a dropped connection (see the script). | |
| codesign --verify --deep --strict --verbose=2 "$app" | |
| spctl -a -t exec -vv "$app" | |
| STAPLER_ACTION=validate desktop/scripts/staple-with-retry.sh "$app" | |
| codesign --verify --strict --verbose=2 "${images[0]}" | |
| spctl -a -t open --context context:primary-signature -vv "${images[0]}" | |
| STAPLER_ACTION=validate desktop/scripts/staple-with-retry.sh "${images[0]}" | |
| # Hardened runtime is what notarization requires and what the Entitlements.plist assumes; | |
| # a build that lost the flag is notarized today and rejected by the next macOS. | |
| codesign -dv --verbose=4 "$app" 2>&1 | tee "$RUNNER_TEMP/codesign.txt" | |
| grep -q 'flags=.*runtime' "$RUNNER_TEMP/codesign.txt" | |
| if grep -q 'Signature=adhoc' "$RUNNER_TEMP/codesign.txt"; then | |
| echo '::error::The app is ad-hoc signed.' | |
| exit 1 | |
| fi | |
| # The CLI is in the app, and every Mach-O in it is ours, hardened and timestamped. | |
| desktop/scripts/verify-cli-bundle.sh "$app" developer-id | |
| # The 1Password helper is in the app, ours, hardened and timestamped, with only the | |
| # entitlement that lets it load 1Password's library. | |
| desktop/scripts/verify-onepassword-helper.sh "$app" developer-id | |
| # Every Mach-O in the app, the bundled Node and the CLI's native modules included, is built for | |
| # this job's architecture, and the image holds that same app. The Intel build is made on an | |
| # Apple silicon runner, so this is what proves it is an Intel app. ROSETTA_CHECK=1 also starts the | |
| # signed 1Password helper once and asks it `hello`: natively on the Apple silicon build, under | |
| # Rosetta on the Intel one. | |
| - name: Verify the app is built for its architecture | |
| env: | |
| LIPO_ARCH: ${{ matrix.platform.lipo-arch }} | |
| run: | | |
| set -euo pipefail | |
| ROSETTA_CHECK=1 desktop/scripts/verify-mac-arch.sh "$BUNDLE/macos/OpenBot.app" "$LIPO_ARCH" | |
| images=("$BUNDLE"/dmg/*.dmg) | |
| mount="$RUNNER_TEMP/openbot-arch-check" | |
| mkdir -p "$mount" | |
| hdiutil attach -readonly -nobrowse -mountpoint "$mount" "${images[0]}" | |
| trap 'hdiutil detach "$mount"' EXIT | |
| desktop/scripts/verify-mac-arch.sh "$mount/OpenBot.app" "$LIPO_ARCH" | |
| codesign --verify --deep --strict --verbose=2 "$mount/OpenBot.app" | |
| # Named by architecture because both builds produce `OpenBot.app.tar.gz`, and latest.json | |
| # points at one URL per platform. A pinned build made no updater archive. | |
| - name: Collect the artifacts | |
| env: | |
| TARGET: ${{ matrix.platform.target }} | |
| UPDATER: ${{ steps.build.outputs.updater }} | |
| run: | | |
| set -euo pipefail | |
| mkdir -p signed | |
| cp "$BUNDLE"/dmg/*.dmg signed/ | |
| if [ "$UPDATER" = true ]; then | |
| cp "$BUNDLE/macos/OpenBot.app.tar.gz" "signed/OpenBot-$TARGET.app.tar.gz" | |
| cp "$BUNDLE/macos/OpenBot.app.tar.gz.sig" "signed/OpenBot-$TARGET.app.tar.gz.sig" | |
| elif [ -e "$BUNDLE/macos/OpenBot.app.tar.gz" ]; then | |
| echo '::error::A build with no updater made an updater archive.' | |
| exit 1 | |
| fi | |
| cp desktop/build-version.json signed/ | |
| ls -l signed | |
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: openbot-macos-signed-${{ matrix.platform.target }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: signed/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| # Always, and by name rather than by pattern: a signing key left unlocked in a keychain on a | |
| # runner that is about to be reused is the one piece of this that does not clean itself up. | |
| - name: Remove the temporary keychain | |
| if: ${{ always() }} | |
| run: | | |
| rm -f "$RUNNER_TEMP/AuthKey.p8" "$RUNNER_TEMP/developer-id.p12" | |
| if [ -n "${SIGNING_KEYCHAIN:-}" ] && [ -f "$SIGNING_KEYCHAIN" ]; then | |
| security delete-keychain "$SIGNING_KEYCHAIN" || true | |
| fi | |
| # latest.json is the whole updater. It names a version, a URL per platform, and the minisign | |
| # signature of the file at that URL; the app refuses anything whose signature does not verify | |
| # against the public key it was built with. Both architectures are written into it here, from | |
| # their real `.sig` files, rather than by hand, beside the Windows installer that Desktop Windows | |
| # signing lists in the same file (scripts/release-update-feed.sh). | |
| # | |
| # This job, or Desktop Windows signing's, is also where a stable release becomes Latest: | |
| # publish-release.yml publishes it not Latest, so `releases/latest` keeps serving the previous | |
| # signed installers until both signing runs have attached theirs, and whichever finishes second | |
| # marks it (scripts/release-make-latest.sh). A candidate or beta attaches its pinned .dmg files | |
| # and nothing else. The details are in desktop/scripts/publish-signed-mac.sh. | |
| publish: | |
| name: Publish latest.json | |
| needs: sign | |
| # One attach job at a time per release, across Desktop macOS signing and Desktop Windows | |
| # signing: each ends by asking whether every signed installer is on the release, and the one | |
| # that runs second must see what the first attached, or neither would make it Latest. Same | |
| # group in both workflows; an attach that is running is never cancelled. | |
| concurrency: | |
| group: release-attach-${{ inputs.release-tag || github.ref_name }} | |
| cancel-in-progress: false | |
| if: >- | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || | |
| (github.event_name == 'workflow_dispatch' && inputs.release-tag != '') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| # `actions: write` to start Downloads sync when this run makes the release Latest | |
| # (scripts/release-make-latest.sh). | |
| permissions: | |
| contents: write | |
| actions: write | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_TAG: ${{ inputs.release-tag || github.ref_name }} | |
| # Empty on a pushed tag, which therefore never moves Latest. | |
| MAKE_LATEST: ${{ inputs.make-latest }} | |
| # Tags kept from Latest for a staged rollout (scripts/release-make-latest.sh). | |
| HOLD_LATEST: ${{ vars.RELEASE_HOLD_LATEST }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| pattern: openbot-macos-signed-* | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Attach to the release, and make it Latest when it should be | |
| run: desktop/scripts/publish-signed-mac.sh |