Repository navigation
Release v1.2.4 #2502
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 Windows signing | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| signing-mode: | |
| description: Opt in to signing with the protected Azure Key Vault certificate | |
| type: choice | |
| options: [none, keyvault] | |
| default: none | |
| required: true | |
| release-tag: | |
| description: Attach the signed installer to this existing release. Run from that tag. | |
| type: string | |
| default: "" | |
| required: false | |
| # publish-release.yml says whether the release becomes Latest. A stable release becomes | |
| # Latest once both this and Desktop macOS signing have attached their signed installers, | |
| # in whichever finishes second. Signing a release again by hand leaves Latest alone 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 | |
| # A label permits validation before this workflow exists on main. New pushes | |
| # run only the checks: remove/reapply the label to request signing a new head. | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| paths: | |
| - desktop/** | |
| - package.json | |
| - .github/workflows/desktop-signing.yml | |
| - .github/workflows/publish-release.yml | |
| - scripts/release-* | |
| - docs/windows-signing.md | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: desktop-windows-signing-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: false | |
| # Match the source publisher's exact repository/distribution identity in official and fork builds. | |
| env: | |
| OPENBOT_DISTRIBUTION_ID: ${{ vars.OPENBOT_DISTRIBUTION_ID || github.repository }} | |
| OPENBOT_RELEASE_REPOSITORY: ${{ github.repository }} | |
| OPENBOT_RELEASE_CHANNEL: ${{ vars.OPENBOT_RELEASE_CHANNEL || 'stable' }} | |
| jobs: | |
| checks: | |
| name: Signing regressions (no Azure access) | |
| runs-on: windows-2025 | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| persist-credentials: false | |
| - name: PowerShell signing regressions | |
| shell: pwsh | |
| run: ./desktop/scripts/test-windows-signing.ps1 | |
| # A stable release becomes Latest only once this workflow's signed installer is on it too, so | |
| # the Windows download link never serves the unsigned one. The scripts behind it run in | |
| # Updater regressions (no Apple access) and the main test suite; this checks the wiring here. | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| - name: Latest waits for the signed Windows installer | |
| run: bun test scripts/signing-workflows.test.ts | |
| working-directory: desktop | |
| sign: | |
| name: Sign and verify app and NSIS installer | |
| needs: checks | |
| outputs: | |
| # The artifact of the attempt that signed, so a re-run of `publish` alone attaches the | |
| # installer that attempt verified, not one from an earlier attempt. | |
| artifact: openbot-windows-signed-${{ github.run_id }}-${{ github.run_attempt }} | |
| # Whether the build carries the updater: every build but a pinned candidate or beta. | |
| updater: ${{ steps.build.outputs.updater }} | |
| if: >- | |
| (github.event_name == 'workflow_dispatch' && inputs.signing-mode == 'keyvault') || | |
| (github.event_name == 'pull_request' && github.event.action == 'labeled' && | |
| github.event.label.name == 'windows-signing' && | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| environment: windows-signing | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'windows-2025' || 'openbot-windows-16core' }} | |
| timeout-minutes: 60 | |
| defaults: | |
| run: | |
| shell: pwsh | |
| env: | |
| AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} | |
| AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} | |
| AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
| AZURE_KEY_VAULT_URL: ${{ vars.AZURE_KEY_VAULT_URL }} | |
| CODE_SIGNING_CERT_NAME: ${{ vars.CODE_SIGNING_CERT_NAME }} | |
| SIGNING_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
| AZURE_CORE_OUTPUT: none | |
| 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.event.pull_request.head.sha || github.sha }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check signing configuration | |
| run: | | |
| foreach ($name in @('AZURE_CLIENT_ID', 'AZURE_TENANT_ID', 'AZURE_SUBSCRIPTION_ID', 'AZURE_KEY_VAULT_URL', 'CODE_SIGNING_CERT_NAME')) { | |
| if ([string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($name))) { | |
| throw "Missing windows-signing environment variable: $name" | |
| } | |
| } | |
| if ((git rev-parse HEAD) -ne $env:SIGNING_SOURCE_SHA) { throw 'Checkout does not match requested source SHA.' } | |
| - uses: azure/login@a641126d1b8aa4d1fa005f4f92df94a3a4c4c906 # v3.1.0 | |
| with: | |
| client-id: ${{ vars.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ vars.AZURE_TENANT_ID }} | |
| subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
| - name: Check certificate access | |
| run: | | |
| az keyvault certificate show --id "$env:AZURE_KEY_VAULT_URL/certificates/$env:CODE_SIGNING_CERT_NAME" --query id --output tsv --only-show-errors | |
| if ($LASTEXITCODE -ne 0) { throw 'Could not read signing certificate.' } | |
| # No caches in this job, Rust or Bun: a release attaches what it builds, and a signed | |
| # installer must come from the tree and the lockfiles, not from anything an earlier run left | |
| # behind. The same rule as Desktop macOS signing. | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 | |
| with: | |
| toolchain: stable | |
| # Go builds the 1Password helper (desktop/scripts/onepassword-helper.ts) with CGO_ENABLED=0, so | |
| # no C compiler. The same release as Desktop macOS signing, and no cache, by the rule above. | |
| - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 | |
| with: | |
| go-version: 1.26.11 | |
| cache: false | |
| - name: Install pinned AzureSignTool | |
| run: | | |
| $toolDirectory = Join-Path $env:RUNNER_TEMP 'azuresigntool-7.0.1' | |
| New-Item -ItemType Directory -Path $toolDirectory -Force | Out-Null | |
| $tool = Join-Path $toolDirectory 'AzureSignTool.exe' | |
| Invoke-WebRequest 'https://github.com/vcsjones/AzureSignTool/releases/download/v7.0.1/AzureSignTool-x64.exe' -OutFile $tool | |
| if ((Get-FileHash -LiteralPath $tool -Algorithm SHA256).Hash -ne 'DC85A3F24BCD5978C63FCFD167A9B41313AF9116722B99B831400F05F387FCBA') { | |
| throw 'AzureSignTool download hash mismatch.' | |
| } | |
| $toolDirectory | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8 | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - run: bun run typecheck | |
| working-directory: desktop | |
| # A tag is a release, and its installer carries the release version, as the unsigned one | |
| # it replaces does. Anything else is an internal build named after its commit. | |
| - name: Prepare the build version | |
| run: | | |
| if ($env:GITHUB_REF_TYPE -eq 'tag') { | |
| bun scripts/desktop-version.ts release | |
| } else { | |
| bun scripts/desktop-version.ts internal | |
| } | |
| if ($LASTEXITCODE -ne 0) { throw 'Could not prepare the build version.' } | |
| Get-Content build-version.json | |
| working-directory: desktop | |
| # signed-build.ts builds what desktop-build.yml built for the same release: a candidate or | |
| # beta pinned to its release's images, and the CLI whenever the tree can bundle one. On a | |
| # release this signed installer replaces the unsigned one, so it must be the same product. | |
| # Anything else (a pull request, a branch) is an ordinary internal build, as before. | |
| # The overlay also carries the updater, `plugins.updater` with the same public key and | |
| # endpoints as the Mac's, so a signed Windows app is offered and installs updates the way a | |
| # Mac does. Not `createUpdaterArtifacts`: the updater key is not in this environment, and the | |
| # file the Windows updater installs is this installer itself, signed for it by `sign-update`. | |
| # Tauri downloads NSIS from GitHub the first time it bundles, once and with no retry, and a 504 | |
| # there fails the release. This puts the same pinned, checksummed toolset desktop-build.yml | |
| # fetches where Tauri looks first, so the build below downloads nothing. Not a cache: the | |
| # files come from their releases on every run and are checked against pins in the tree. | |
| - name: Fetch Tauri's bundling tools | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: desktop/scripts/prefetch-tauri-tools.sh windows | |
| - name: Build and sign | |
| id: build | |
| env: | |
| WINDOWS_SIGNING: keyvault | |
| # To read the release's container-images.json when this build is a candidate. | |
| GH_TOKEN: ${{ github.token }} | |
| run: bun scripts/signed-build.ts win32 x64 src-tauri/tauri.windows-signing.conf.json --bundles nsis | |
| working-directory: desktop | |
| # Tauri restores the unsigned build output after bundling. Verify the app | |
| # employees receive by extracting its signed payload from the installer. | |
| - name: Extract signed app from NSIS installer | |
| run: | | |
| $installers = @(Get-ChildItem 'desktop/src-tauri/target/release/bundle/nsis/*-setup.exe' -File) | |
| if ($installers.Count -ne 1) { throw 'Expected exactly one NSIS installer.' } | |
| & 7z e $installers[0].FullName '-odesktop/signed-app' '-r' '-y' 'openbot-desktop.exe' | |
| if ($LASTEXITCODE -ne 0) { throw 'Could not extract signed app from NSIS installer.' } | |
| # The 1Password helper, signed by signed-build.ts before the app was built. | |
| & 7z e $installers[0].FullName '-odesktop/signed-app' '-r' '-y' 'openbot-1password.exe' | |
| if ($LASTEXITCODE -ne 0) { throw 'Could not extract the 1Password helper from NSIS installer.' } | |
| if (-not (Test-Path -LiteralPath 'desktop/signed-app/openbot-1password.exe' -PathType Leaf)) { throw 'The installer has no 1Password helper.' } | |
| # The CLI is in what people install, not only in the build folder. | |
| - name: Verify the installer carries the Intelligence CLI | |
| run: | | |
| $installers = @(Get-ChildItem 'desktop/src-tauri/target/release/bundle/nsis/*-setup.exe' -File) | |
| $listing = & 7z l $installers[0].FullName | |
| if ($LASTEXITCODE -ne 0) { throw 'Could not list the NSIS installer.' } | |
| foreach ($file in @('cli-bundle\runtime\node.exe', 'cli-bundle\cli\index.js', 'onepassword-helper\openbot-1password.exe')) { | |
| if (-not ($listing | Select-String -SimpleMatch $file)) { throw "The installer has no $file." } | |
| } | |
| - name: Verify publisher, trust, and timestamp on every executable | |
| run: | | |
| $build = Get-Content desktop/build-version.json -Raw | ConvertFrom-Json | |
| ./desktop/scripts/verify-windows-signatures.ps1 -ExpectedVersion $build.version -HelperPath desktop/signed-app/openbot-1password.exe | |
| - name: Retain verified binaries | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: openbot-windows-signed-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: | | |
| desktop/signed-app/openbot-desktop.exe | |
| desktop/signed-app/openbot-1password.exe | |
| desktop/src-tauri/target/release/bundle/nsis/*-setup.exe | |
| desktop/build-version.json | |
| if-no-files-found: error | |
| retention-days: 14 | |
| - name: Retain verification evidence | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: openbot-windows-signatures-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: desktop/signing-evidence/ | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| # The updater's signature over the installer. On Windows the updater installs the NSIS installer | |
| # itself, so it is signed here, after Authenticode signing, over exactly the bytes the signing job | |
| # verified and people download. The updater key is the one Desktop macOS signing signs with, and | |
| # it lives in the `macos-signing` environment only, so this job runs there: its reviewers approve | |
| # it as they approve the Mac build, and the key is never in `windows-signing`. It needs no | |
| # repository write access and no Azure access. Only a run that attaches to a release signs for | |
| # the updater; a pinned candidate or beta has no updater. | |
| sign-update: | |
| name: Sign the installer for the updater | |
| needs: sign | |
| if: >- | |
| github.event_name == 'workflow_dispatch' && inputs.release-tag != '' && | |
| needs.sign.outputs.updater == 'true' | |
| environment: macos-signing | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| outputs: | |
| artifact: openbot-windows-updater-signature-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: 1.4.3 | |
| no-cache: true | |
| # The Tauri CLI the build used, from the lockfile, to sign as `tauri build` signs. | |
| - run: bun install --frozen-lockfile | |
| working-directory: desktop | |
| - name: Install minisign | |
| run: sudo apt-get install -y --no-install-recommends minisign | |
| - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: ${{ needs.sign.outputs.artifact }} | |
| path: artifacts | |
| - name: Sign and verify against the app's public key | |
| env: | |
| ARTIFACTS: artifacts | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| run: desktop/scripts/sign-windows-update.sh | |
| - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | |
| with: | |
| name: openbot-windows-updater-signature-${{ github.run_id }}-${{ github.run_attempt }} | |
| path: artifacts/src-tauri/target/release/bundle/nsis/*-setup.exe.sig | |
| if-no-files-found: error | |
| retention-days: 14 | |
| # The signed installer onto the release, from a job of its own so the signing job never holds a | |
| # token that can write to the repository. It replaces the unsigned installer the release was | |
| # published with, under the name Tauri gave it and under the fixed name a web page links to | |
| # (scripts/release-download-names.sh). Both, or the stable link keeps serving the unsigned build. | |
| # For a build with the updater it attaches the updater signature too, and lists the installer in | |
| # latest.json as `windows-x86_64`, beside the Mac archives. `--clobber` makes a re-run replace | |
| # them again. The details are in desktop/scripts/publish-signed-windows.sh. | |
| publish: | |
| name: Attach to the release | |
| needs: [sign, sign-update] | |
| # 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 | |
| # After sign-update, or without it for a pinned build, which it skips. | |
| if: >- | |
| !cancelled() && needs.sign.result == 'success' && | |
| (needs.sign-update.result == 'success' || needs.sign-update.result == 'skipped') && | |
| 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 }} | |
| 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: | |
| name: ${{ needs.sign.outputs.artifact }} | |
| path: artifacts | |
| - if: needs.sign-update.result == 'success' | |
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | |
| with: | |
| name: ${{ needs.sign-update.outputs.artifact }} | |
| path: artifacts/updater-signature | |
| - name: Attach to the release | |
| env: | |
| ARTIFACTS: artifacts | |
| run: desktop/scripts/publish-signed-windows.sh |