Skip to content

Sign Windows and macOS release packages - #4

Merged
dautovri merged 2 commits into
zflashfrom
signed-releases
Nov 20, 2026
Merged

dautovri merged 2 commits into
zflashfrom
signed-releases

Conversation

@dautovri

Copy link
Copy Markdown
Member

Releases of ZFlash currently ship a Windows installer signed with a self-signed certificate ("Unknown publisher", SmartScreen blocks it) and an unsigned macOS DMG (Gatekeeper rejects it). This signs both with ZEDEDA's real certificates, the same ones Raven uses.

Windows

  • The app, the installer and its uninstaller are signed by Zededa Germany GmbH through Azure Artifact Signing, timestamped by Microsoft.
  • The job signs in to Azure with GitHub OIDC: no certificate or password is stored in GitHub.
  • New CMake options IMAGER_SIGN_DLIB / IMAGER_SIGN_DLIB_METADATA make signtool use the Azure signing library. Local signing with a certificate (IMAGER_SIGN_CERT_SHA1, build-win-selfsigned.ps1) still works.

macOS

  • The app and the DMG are signed with the Developer ID of Zededa Germany GmbH (team MD4U27PD8W), the DMG is notarized by Apple and the ticket is stapled.
  • create_styled_dmg.sh.in now signs inside-out and stops on any signing failure (before, failures were only warnings), signs the DMG itself, and names the app, volume and DMG after ZFlash instead of "Raspberry Pi Imager".

Release flow

  • release.yml: signing is now on by default (sign input replaces sign-windows).
  • The Windows and macOS jobs run in the new zflash-release environment: an approval is required, only the zflash branch may use it, and the signing variables and secrets live there.
  • Both jobs end with a check that fails the release unless the signatures are valid, timestamped and from the expected signer.
  • Pull request builds are never signed.

Setup already done

  • zflash-release environment with its variables and secrets.
  • Azure federated credential trusting repo:zededa/zflash:environment:zflash-release.
  • The old WINDOWS_SIGNING_PFX* repository secrets are no longer used; they can be deleted after the first signed release.

Testing

  • This PR's own build checks that unsigned builds still work.
  • A signed test release is run as a draft before merging.

🤖 Generated with Claude Code

Windows: sign the app, the installer and its uninstaller through Azure
Artifact Signing (Zededa Germany GmbH). The job signs in with GitHub OIDC;
CMake gains IMAGER_SIGN_DLIB / IMAGER_SIGN_DLIB_METADATA so signtool uses
the Azure signing library instead of a certificate in the local store.

macOS: sign the app and the DMG with the Developer ID of Zededa Germany
GmbH, notarize the DMG with Apple and staple the ticket. The signing script
now signs inside-out and stops on any failure, and names the app, volume and
DMG after ZFlash instead of Raspberry Pi Imager.

Signing runs only in the zflash-release environment (approval required,
zflash branch only) and is on by default for releases; pull request builds
stay unsigned. Both jobs end with a check that fails the release unless the
signatures are valid, timestamped and from the expected signer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@orca-security-us orca-security-us Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed OSS Licenses high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

if: inputs.sign-windows
- name: Sign in to Azure
if: inputs.sign
uses: azure/login@v2
Apple can hold a new app's notarization for "in-depth analysis" for hours
or days. The macOS job now uploads the DMG, waits up to 20 minutes and, if
Apple is still reviewing it, carries on with the signed DMG marked as
pending instead of failing. The release is then always created as a draft
with a note naming the Apple submission.

New "Finish macOS notarization" workflow (run by hand with the release
tag): asks Apple about that submission; once accepted it staples the DMG,
checks it with Gatekeeper, replaces the DMG and its SHA256SUMS line in the
draft and removes the note. While Apple is still reviewing it, it says so
and stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dautovri

Copy link
Copy Markdown
Member Author

Added after the first signed test run sat in Apple notarization for 48+ minutes (Apple holds new apps for "in-depth analysis"):

  • The macOS job now waits at most 20 minutes for Apple. If Apple is still reviewing, the DMG is kept (signed, marked pending) and the release is always created as a draft with a note naming the Apple submission.
  • New Finish macOS notarization workflow (Actions → run with the release tag): once Apple accepts, it staples the DMG, checks it with Gatekeeper, replaces the DMG and its SHA256SUMS line in the draft and removes the note. While Apple is still reviewing, it just says so.

GitHub only lists a new manual workflow once it is on the default branch, so it can be run after this PR is merged.

🤖 Generated with Claude Code

@dautovri
dautovri merged commit e6128ee into zflash Nov 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants