* Prepare dormant PhotoCraft release-ref nightly callers
* Keep dormant nightly callers lintable and guarded
* Refresh dormant nightly policy and shared-source pin
* Pin the dormant nightly callers to merged craft-common-actions main
craft-common-actions #330 merged as 077d4657. Both reusable workflows keep the
same inputs and secrets; the callers stay literally off.
* Finish the Nightly session in the app's exit hook
On macOS every quit (Cmd+Q, the close button, File > Quit, app.quit) leaves
through craft::quit, which sends -[NSApplication terminate:]. winit's
applicationWillTerminate: delivers LoopExiting, eframe runs the app's
on_exit, and AppKit then ends the process, so eframe::run_native never
returns there and the controlled-return code after it (the Nightly
session finish) never ran: every Mac Nightly start reported the previous
session as unclean.
Services gets an at_exit hook that on_exit runs once, last. The desktop
app finishes the shared Nightly session there, and again after run_native
for the paths that create no window (renderer failure), where the second
call is a no-op.
* Add the Apple-silicon Nightly build, signing and verification scripts
packaging/macos/nightly.sh compiles the GUI-only PhotoCraft Nightly.app
for aarch64 with no signing material (it refuses any) and writes the
unsigned photocraft-<version>-macos-aarch64-nightly.zip: the nightly-common
source and identity checks, nightly_plist.py's Info.plist, the Nightly icon
and notices, no CLI, DMG or document types, zipped without xattrs. It no
longer runs the bundle before signing.
packaging/macos/nightly-sign.sh is the trusted step the shared signer calls
(--arch aarch64 --input <unsigned zip> --output <final zip>). It requires
all six release secrets, imports the Developer ID with import-cert.sh into
a private keychain it deletes on exit, signs inside-out with the hardened
runtime, timestamp and entitlements, notarizes with notarytool, staples the
ticket into the bundle, and checks the final archive as the Launcher
unpacks it (signature, team, ticket, Gatekeeper) before writing it without
replacing anything. It never compiles or runs the payload.
packaging/macos/nightly-verify.sh runs in a job without secrets (it refuses
any): the same archive checks, then the bundle's --version with an empty
environment, for the signed feed artifact or the unsigned compile output.
nightly-common.sh splits the compile from the version query; Linux keeps
both. The new suite runs the scripts against stand-in Apple tools.
* Build the unsigned macOS Nightly in pull-request CI
A hosted macos-15 job, with no secrets or environment, builds the
aarch64 Nightly bundle with packaging/macos/nightly.sh when a pull
request changes the Mac Nightly packaging or flavor, and checks it with
nightly-verify.sh --expect unsigned, including the bundle's version.
* Add the Linux row to the dormant nightly callers
The single unsigned producer job lists linux-x86_64 beside windows-x86_64:
one producer run builds both platforms for one all-or-nothing release, and
the release-ref signer admits platforms from the protected policy, so there
is no separate Linux job and nightly-sign.yml is unchanged. The pinned shared
revision has no platforms input or Linux leg yet; the callers must be
re-pinned to a reviewed commit that defines them before activation. Every
job stays literally off.
The policy example moves to v3 with a per-platform map; each platform keeps
only its own trust anchor and every authority value stays null.
Packaging lint path filters now cover the files the contract tests read: the
policy example, the installed policy and Linux key paths, and the Sonar
properties.
* Cap the failure-only notarization log in nightly-sign.sh
The shared signer bounds a step's output at 256 KiB; notarytool's log on a
rejected submission is the one large output, now cut at 128 KiB.
* Add the macOS row and stable trust anchors to the dormant nightly callers
The single producer job now lists windows-x86_64, linux-x86_64 and
macos-aarch64, so one producer run builds all three platforms for one
all-or-nothing release. The signer caller still has no platform input; the
release-ref signer admits platforms from the protected v3 policy and reads
signing secrets from the release environment, so neither caller forwards
secrets.
Both callers pin a placeholder for the unmerged multi-platform shared
signer. It must be replaced with the reviewed merged commit before this is
published or activated. Every job stays literally off with no schedule.
The v3 policy example now carries each platform's fixed
nightly-unsigned-<platform> artifact kind and stable's public identities:
the Windows Authenticode subject, the Linux release key fingerprint and the
Apple Developer ID team DJ6XS33FX8 (read from the v0.23.1 macOS code
signature). Other authority values stay null and no policy is installed.
.github/nightly-linux-signing-key.asc is the v0.23.1 release-signing-key.asc
byte for byte. The contract tests check that it holds exactly one public
primary key matching the policy fingerprint, that every platform row names its
artifact kind and identity, and that both callers share one pin.
* Address review: macOS-only exit hook, clean-tree recheck, wider refusals
- The Nightly exit hook is installed only on macOS; Linux and Windows keep
finishing the session after run_native returns.
- nightly_build_gui checks the tree is still clean after --version (Linux).
- nightly_refuse_signing_env also refuses the Windows, Azure and Linux
signing names release.yml passes.
- nightly-sign.sh drops the single spctl run before the retried final check.
- nightly-macos.yml also runs for Cargo.toml, Cargo.lock and the text and
ui-egui build scripts.
* List the macOS Nightly signing tests as tests for Sonar
packaging/macos/nightly_sign_tests.py is a fixture runner like the other
nightly suites; without this Sonar counts it as production code.
* Run the macOS Nightly PR build only with the full-ci label
macOS runners are shared with release builds: no path filters, and a pull
request runs the job only when it carries full-ci (a labeled event only
when the added label is full-ci). ci.yml's concurrency pattern keeps other
labels from running or cancelling a run. workflow_dispatch stays.
* Pin the nightly callers to the merged multi-platform shared signer
Both callers now name craft-common-actions a4f6fd51e854773de8b24b4f92e1ad7e770c08d7, the main
commit that merged #342 (policy v3, the platforms input and the Linux and
macOS legs, all switched off), in uses and tooling-revision. The contract
test now also requires a full 40-character commit for the shared pin.
Every job stays literally off with no schedule.
* Keep the unsigned macOS Nightly archive as a short-lived artifact
Seven-day retention, unsigned zip only, no secrets. It lets keyless signer tests and hand
testing use the exact verified build.
* Keep unlabelled events out of the macOS build's concurrency group
A push to a full-ci PR and the label event arrive together; the event that would be skipped
was sharing the group and cancelling the real build.
* Stop the macOS Nightly scripts' --help at their header comment
* Answer the Launcher's profile-form version query before startup (#16559)
`PhotoCraft --launch-profile nightly-v1 --profile-root <dir> --version`,
the shared producer's smoke, was refused by the strict launch-profile
parser (no `--`), and the refusal opens a native dialog on macOS, which
never returns on a headless runner: the hosted run did not exit in 180 s.
A Nightly build now treats exactly the selector/root pair followed by
`--version` or `-V` as a version query: the same line as plain
`--version`, exit 0, before root validation, process identity, IPC or any
window. Only parse()'s lexical checks apply; every other refusal is
unchanged and `-- --version` stays a file name.
nightly-verify.sh checks both forms, each within 15 seconds and with
nothing on standard error, so the PR's Mac build covers the smoke.
* Harden the Mac Nightly signing helpers (review of #16559)
- nightly_publish_archive runs python3 -I: nightly-sign.sh calls it with
the signing secrets loaded, so no module from the working directory or
user site may be imported.
- nightly-sign.sh and nightly-verify.sh list the archive's entries before
unpacking (python3 -I, zipfile) and refuse absolute paths, `..`, empty
or backslash components, entries outside PhotoCraft Nightly.app, links
and special files. The check after unpacking stays.
- The signature check matches the Identifier line literally (grep -F).
* Describe the three-platform nightly and the two signing entities
releasing.md now covers Windows, Linux and macOS and names the macOS signing
scripts and the Linux public key in the release trust review. The preparation
guide lists `platforms` among the unsigned inputs and states the exact macOS
Developer ID leaf (Learning Machines LLC, team DJ6XS33FX8). The Windows
certificate names Learning Machines Inc, and only the team ID is enforced on
macOS.
* Enable the PhotoCraft nightly for supervised manual runs
The producer and release-ref signer callers drop their literal off-guard and
keep only their exact context guards. Both run only when dispatched by the
reviewed manual actor, skylartaylor, who is listed in the producer's
manual-actors and in the policy. nightly-dispatch.yml stays off and there is
no schedule.
.github/nightly-signing-policy.json installs the v3 policy from values read
at their sources: the repository ID, the callers' shared pin, CI's workflow
and jobs, the SonarCloud project, gate and open vulnerabilities, and the
stable v0.23.1 platform identities. producer_workflow_id stays null until
nightly.yml is registered on main, so the shared validator refuses the policy
until that ID is committed.
The contract tests check the guards, the manual actor, the policy's ties to
the callers, Sonar properties and CI triggers. The preparation guide lists
each value's source.
* Pin the nightly callers to craft-common-actions #339
Both callers and the policy's tooling revisions move from a4f6fd51 (#342) to
605d58766e8f536564da8fc81d3676ac86816dea, the main commit that merged #339:
bounded lineage compares, an unresolved-issue reread at the end of candidate
admission and a 1024-character Windows subject bound at policy validation.
Neither callee's inputs nor the policy fields change.
* Let every release manager who can push start nightly runs by hand
The producer's manual-actors and the policy's manual_actors are now the five
members of the release-managers team (id 19837241) with push access:
bflatastic, dylanmtaylor, echelon, FredApps and skylartaylor, sorted the same
way in both. echelon-robot only has read access and is left out. There is
still no automatic signer, no schedule, and the dispatcher stays off.
The contract test requires that exact list in both places and refuses an
actor outside it, a reordered list or a case change.
* Fill in the producer workflow ID now that nightly.yml is on main
producer_workflow_id is 428462603, read from
gh api repos/storytold/photocraft/actions/workflows/nightly.yml (path
.github/workflows/nightly.yml, state active). The shared validator at the
callers' pin now accepts the policy as committed, and the contract test
requires a real numeric ID.
* Bring the nightly guide in line with the enabled callers
The guide no longer says the manual-actor lists are empty or the policy is
unpopulated: the producer and the installed policy both list the five
release managers. The test description now says only the dispatcher must
stay explicitly off, while the enabled producer and signer are checked for
their exact guards. The Windows subject bound is 1024 characters, as
validated since #339, and the remaining "dormant" wording is gone.
* Accept main's current Sonar vulnerabilities as debt for the first run
The policy's Sonar debt is now exactly main's 15 open VULNERABILITY issues,
re-read live from SonarCloud at analysis 19880b44-8bb0-4538-a124-437045a56be2
(commit 27c629f789): the 8 pinned before plus 7 new
pythonsecurity:S8707 issues in scripts/engine_split. The gate conditions are
unchanged. The epoch names the new analysis, and the guide records it.
* Move the nightly signer to the dedicated nightly-signer branch
nightly-sign.yml now runs only on refs/heads/nightly-signer, the dispatcher
(still off) targets that full ref, and the policy's release_branch names it,
so nightly signer files never need a stable release sync.
The contract tests add the trust-closure scan for that branch: no app
workflow binds an environment, only nightly-sign.yml calls nightly-release.yml
and it pins a full SHA, and the only caller of the shared stable release.yml
is release.yml. The guides describe the branch, its advance procedure and its
trust closure (all of .github/ and packaging/, including packaging/env.sh).
The shared pin is unchanged here; the shared signer at the current pin only
accepts release, so this needs the re-pin to the shared nightly-signer change.
* Pin the nightly callers to the shared signer-branch change
Both callers' uses and tooling-revision and the policy's tooling revisions
and producer_workflow_ref move to craft-common-actions 00ad6b9b691ff642feabde191c4fab678ebbddde,
which signs on the policy's signer branch (release or nightly-signer) and is
stacked on #363. nightly-sign.yml passes app-name: photocraft, which #363
makes required. Re-pin to the merge commit once the shared PR lands.
* Pin the nightly callers to the merged signer-branch change (#364)
Both callers' uses and tooling-revision, the policy's two tooling revisions
and producer_workflow_ref, and the guide move from 00ad6b9b to
88148a57ef09ef407d73c0f385e04cc7f4c2720a, the craft-common-actions main commit that
merged #364 (on top of #363). app-name: photocraft, the nightly-signer guard
and the policy's signer branch are unchanged.
* Read workflow keys properly in the nightly-signer trust-closure scan
The scan matched only an unquoted `environment:` at a line start, so a quoted
"environment": release key slipped through. It now reads every mapping key
with a narrow reader (no YAML parser ships with the runner's Python): plain,
single- and double-quoted keys in block and simple one-line flow mappings,
skipping block scalar bodies. It refuses the forms that could still hide a
key: escaped double-quoted keys, explicit keys, merge keys, anchors,
aliases, tags, tabs and nested or multi-line flow.
New refusal cases cover each form, and the accepted tree stays clean.
* Take every key the nightly-signer scan inspects from the workflow reader
The caller checks still found `uses:` with a regex over the raw text, so a
copied signer caller under a quoted "uses": key slipped past while the real
signer still satisfied the count. workflow_entries() now returns each entry's
one-line value and whether it continues over several lines, and
trust_closure_problems reads environment and uses only from it. A uses value
that is escaped, a block scalar or continued is refused, the shared owner and
repository match case-insensitively, and the signer count comes from the
same entries.
New refusal cases cover double- and single-quoted uses keys, a quoted value,
a flow mapping, a differently cased owner, folded and continued values, and a
quoted second signer call; the accepted tree stays clean.
* Make the nightly-signer workflow reader fail closed on quoting
A `#` inside a quoted flow scalar was cut off as a comment, so
`{name: "a} # b", ..., environment: release}` hid the binding. Comments are
now stripped with a quote-aware scan (a quote opens only where a scalar
starts, as in YAML). The reader refuses any line with an unterminated or
multi-line quoted scalar, any flow mapping whose quoted scalars contain
#, {, }, [, ] or a comma, and any flow mapping with an environment or uses
key, which must be block style. ci.yml's matrix rows still read cleanly.
New refusal cases cover the reported mapping, a single-quoted hash, a comma
or bracket in a quoted flow scalar, an unterminated quote, and environment or
uses in any flow mapping.
34 KiB
Releasing PhotoCraft
Every push to the release branch runs .github/workflows/release.yml. The workflow builds
signed installers for macOS, Windows, Linux and the web, plus a FreeBSD tarball, then creates
or updates a draft GitHub Release named PhotoCraft v<version>. Nobody sees a draft until a
maintainer publishes it.
User-facing names say PhotoCraft. Files, binaries and ids stay lowercase (photocraft-<version>-<platform>-<arch>.<ext>, ai.storyteller.photocraft).
In-app update checks
The native desktop app checks the public GitHub latest-release endpoint in a background thread once at launch, with no periodic checks or automatic retries. Preferences › General › Automatically Check for Updates disables the startup check; Help › Check for Updates runs one manually. Checks use a 15-second timeout and a 1 MiB response limit, need no GitHub token, and send no document or personal data. Network failures are quiet during automatic checks and visible in the manual check window. Concurrent requests share one check. HTTPS validates certificates and host names against the operating system's trust store.
Tags must be semantic versions (v0.8.0 or 0.8.0); only published stable versions newer
than the installed workspace version trigger a notice. Drafts and prereleases do not trigger it.
Flatpak builds also check for releases; repository-managed installations are updated through
their package manager. Web/headless frontends have no update transport. No release-workflow
changes are required: publishing a newer stable GitHub Release makes it discoverable.
Cutting a release
-
Bump the version on
main. The only place it lives is[workspace.package] versionin the rootCargo.toml:cargo xtask version # prints the current version, e.g. 0.1.0 cargo xtask version set 0.2.0 # or 0.2.0-rc.1; updates Cargo.toml and Cargo.lockCommit the change (
Cargo.toml+Cargo.lock) through the normal review flow. -
Review the release trust boundary, then merge
mainintorelease(or fast-forward it) and push. The stable workflow starts by itself. Compare the proposed tree with the previous trusted release, not a manifest from main. Review and preserve:- every transitive reusable workflow/action pin. The nightly signer no longer rides this sync:
it runs on the dedicated
nightly-signerbranch (see below), but thereleaseenvironment trusts both branches, so this review still covers everything that can reach it; packaging/windows/sign.ps1, its signing configuration, tool installers and imports;- the macOS nightly signing scripts (
packaging/macos/nightly-sign.sh,nightly-verify.sh,nightly-lib.sh,import-cert.sh) and entitlements, and the Linux public key.github/nightly-linux-signing-key.asc; - every other workflow that can reach the
releaseenvironment, including reusable callees, dynamic environment selection and changed executable dependencies. A new workflow outside the named nightly paths is not exempt.
Stop the sync if that closure is unreviewed. Actual top-level repository/event/branch checks and the existing environment restrictions provide authority, not permanent branch divergence. Main CI changes do not need a separate blanket review gate. This procedure does not repair the stable workflow's existing mutable dependencies, builds or caches.
- every transitive reusable workflow/action pin. The nightly signer no longer rides this sync:
it runs on the dedicated
-
Wait for the draft. After about 30 to 45 minutes (notarization is the slow part), the Releases page has a draft
PhotoCraft v0.2.0, taggedv0.2.0on the pushed commit, with every artifact andSHA256SUMS.txt. The notes are generated from the merged PRs. -
Check it. Download an installer or two and look at the job summaries. Any
::warning::there means a signing secret was missing and that artifact is unsigned. -
Add the scorecard deltas to the draft's notes: what moved in
docs/scorecard.mdsince the previous release. Compare the summary table and the performance table of both tags (git diff v<previous> v<this> -- docs/scorecard.md) and list each area's done / partial / missing change, the scenarios that newly meet their budget or got slower, corpus floors raised, and the change in settings that do nothing. Quote numbers with the baseline's machine and load average. -
Publish the draft in the GitHub UI. Publishing creates the
v0.2.0tag. Versions with a pre-release suffix (-rc.1) are marked as pre-releases.
Pushing to release again before you publish rebuilds the same draft and replaces its assets.
After the draft is published, the workflow refuses to touch that version again, so bump it first.
Test runs: Actions → Release → Run workflow runs the whole pipeline by hand. The optional
version input (such as 0.2.0-rc.1) overrides Cargo.toml for that run only. The jobs apply
it with cargo xtask version set before building, so the binaries report it too. The run still
needs the release environment, which only the release branch can use, so pick that branch
in the dialog.
Release-ref nightly preparation
The Windows, Linux and macOS source preparation is documented in
nightly-release-preparation.md. It is not an activated
signing or publication pipeline. Stable release.yml, its schedule, tags, concurrency,
environment values and environment rules are unchanged.
Stable releases still come only from refs/heads/release. The nightly signer runs on
refs/heads/nightly-signer instead, so signer and policy
updates never need a stable release sync or a release-branch push. That branch is created once at
a reviewed main commit and later only fast-forwards to main commits, by a release manager running
the nightly-signer settings script's advance: it refuses while a nightly-sign run is queued or
running, scans the tree so only the pinned nightly-sign.yml caller can reach an environment, and
prints the full diff of .github/ and packaging/ for review before --apply. That diff is the
trust closure, including packaging/env.sh, which import-cert.sh sources with the Apple keys.
Org rulesets let only release managers create or update the branch and forbid force-pushes and
deletion. Pausing never requires a push: cancel or disable the nightly workflows. Verify the
actual environment permits only the release and nightly-signer branches, excludes main
and same-name tags, and introduces no per-run approval requirement before activation; unresolved
protection or secret-scope collisions are blockers, not permission to change settings.
Nightlies share the existing Windows signing identity with stable. A suspected key or signing service compromise therefore affects both channels: stop/cancel nightlies immediately, notify the release maintainers/security owner privately, and have the identity's authorized owner revoke/rotate it and assess already-signed stable and nightly packages. Stopping one workflow does not revoke signatures or make stable safe. No credentials or identity values are recorded in this procedure.
What gets built
| Platform | Artifacts | Built on |
|---|---|---|
| macOS 11+ (universal: Apple silicon + Intel) | photocraft-<v>-macos-universal.dmg, photocraft-cli-<v>-macos-universal.zip |
macos-15 |
| Windows 10+ x64 | photocraft-<v>-windows-x64.msi, photocraft-<v>-windows-x64-portable.zip, photocraft-<v>-windows-x64-symbols.zip |
windows-latest |
| Windows 10+ x86 (32-bit) | photocraft-<v>-windows-x86.msi, photocraft-<v>-windows-x86-portable.zip, photocraft-<v>-windows-x86-symbols.zip |
windows-latest |
| Linux x86_64 | photocraft-<v>-linux-x86_64.{AppImage,AppImage.zsync,deb,rpm,tar.gz,flatpak} |
ubuntu-22.04 (Flatpak: ubuntu-24.04) |
| Linux aarch64 | photocraft-<v>-linux-aarch64.{AppImage,AppImage.zsync,deb,rpm,tar.gz,flatpak} |
ubuntu-22.04-arm (Flatpak: ubuntu-24.04-arm) |
| Linux riscv64 (glibc 2.39+) | photocraft-<v>-linux-riscv64.tar.gz |
cross-compiled on ubuntu-24.04 (ports.ubuntu.com riscv64 libs); CLI smoke-tested under QEMU |
| FreeBSD 14 x86_64 | photocraft-<v>-freebsd-x86_64.tar.gz |
FreeBSD 14.3 VM on ubuntu-latest |
| Web | photocraft-web-<v>.zip (static site; see packaging/web/README.md) |
ubuntu-latest |
Every binary reports its version, the commit and the build date: photocraft --version,
photocraft-cli --version, and Help › About PhotoCraft. CI sets PHOTOCRAFT_BUILD_SHA and
PHOTOCRAFT_BUILD_DATE, and crates/engine-core/src/build_info.rs reads them at compile time. A plain
cargo build doesn't set them and reports 0.2.0 (dev build).
Every desktop build job (macOS, Windows, Linux, FreeBSD) also checks out craft-fonts
at the craft-fonts-ref commit in .github/workflows/release.yml and builds with CRAFT_FONTS_DIR and
CRAFT_FONTS_REQUIRED=1, so desktop releases embed its Japanese fonts (the web build embeds none: see
docs/development.md › Fonts) and fail rather than ship without them. The packages carry each font's licence as
OFL-<family>.txt (copy_font_licences in packaging/env.sh; the portable zip on Windows;
Contents/Resources/Licenses in the macOS app). Bump the pin deliberately, together with the one
in ci.yml. Build option: docs/development.md › Fonts.
macOS
packaging/macos/package.sh builds aarch64-apple-darwin and x86_64-apple-darwin with
MACOSX_DEPLOYMENT_TARGET=11.0, joins them with lipo, and assembles PhotoCraft.app:
Info.plistis generated fromInfo.plist.in. The bundle id isai.storyteller.photocraft. The plist setsLSMinimumSystemVersion11.0,NSHighResolutionCapable, and document types:.pcraft(Owner), plus PSD/PSB and the image formats PhotoCraft reads (Alternate, so it never takes over Preview's defaults). The icon isassets/app-icon/photocraft.icns.- Signing goes inside-out with the hardened runtime and a secure timestamp. The executable
is signed first, then the bundle. There's no
--deepon the final signature. The entitlements (entitlements.plist) are deliberately empty. - Notarization: the app is zipped and sent with
xcrun notarytool submit --wait, then the ticket is stapled to the app. The app goes on a DMG (hdiutil, with anApplicationslink to drag onto). The DMG is signed, notarized and stapled too. The script checks the results withcodesign --verify --strict,stapler validateandspctl -a -vvv. Its Finder window (background, icon size and positions) comes frompackaging/macos/dmg/, and its volume is namedPhotoCraftwithout the version, which the window's background needs; the DMG file name keeps the version. - CLI:
PhotoCraft.app/Contents/MacOS/photocraft-cliis bundled and signed so generated droplet scripts can run without installing the separate CLI download. The scripts preferPHOTOCRAFT_CLIwhen set, then the bundled CLI in/Applicationsor~/Applications, thenphotocraft-clionPATH. Finder drag-and-drop onto droplets still requires an app wrapper. The universal standalonephotocraft-cliis signed with the same Developer ID, the hardened runtime and a secure timestamp (identifierai.storyteller.photocraft-cli), zipped, and the zip is sent tonotarytool. Only.app,.dmgand.pkgcan hold a stapled ticket, not a bare Mach-O, so Gatekeeper looks the CLI's ticket up online the first time a downloaded (quarantined) copy runs. Offline, that first run can be refused until the Mac is online again. - Verification:
packaging/macos/verify.shchecks the artifacts as users download them. It unpacks the CLI zip and requires, for the binary inside,codesign --verify --strict, both architectures, the hardened runtime flag, aDeveloper ID Applicationauthority fromAPPLE_TEAM_ID, a timestamp, andspctl --assess --type installreportingsource=Notarized Developer ID(the same online lookup Gatekeeper does). For the DMG it runscodesign --verify,stapler validateandspctl --type open. The release workflow runs it as its own step after packaging. With signing secrets it fails the job on any miss; without them it only checks signature integrity and warns, likepackage.sh. Run it locally after a build:packaging/macos/verify.sh --arch aarch64.
Locally, without certificates, the script signs ad-hoc (codesign -s -) and skips notarization.
That's enough to check the bundle and the DMG on your own Mac:
packaging/macos/package.sh # universal; needs both rustup targets
packaging/macos/package.sh --arch aarch64 # quicker, host-only
open dist/release/photocraft-*-macos-*.dmg
Windows
packaging/windows/package.ps1 -Arch x64|x86 builds with -C target-feature=+crt-static.
The static C runtime means neither the MSI nor the portable zip needs the Visual C++
redistributable, which matters for a standalone installer and costs only about 100 KB. The flag
goes in CARGO_TARGET_<TRIPLE>_RUSTFLAGS, so host build scripts aren't affected.
-
apps/photocraft/build.rsandapps/photocraft-cli/build.rsembed the icon (assets/app-icon/photocraft.ico) and VERSIONINFO with thewinresourcecrate (build dependency0.1). They only do this when targeting Windows. Elsewhere each script is a no-op, even ifPHOTOCRAFT_REQUIRE_WINRESis set, and the web build doesn't touch that crate. Both set ProductName to PhotoCraft, CompanyName to Learning Machines LLC and the same copyright line. The GUI description is "PhotoCraft image editor" (photocraft.exe). The CLI description is "PhotoCraft command-line interface", with OriginalFilenamephotocraft-cli.exeand InternalNamephotocraft-cli. Version strings are the Cargo package version, so a pre-release tag is kept; the numeric file and product versions are winresource'smajor.minor.patch.0. A missing resource compiler warns, so an optional cross-compile still links.package.ps1setsPHOTOCRAFT_REQUIRE_WINRES=1. The CLI build script then returns an error namingrc.exeorwindresand does not panic. -
Release builds use the GUI subsystem, so Start Menu launches don't open a console window. The CLI stays console subsystem 3 so its output reaches the terminal.
-
photocraft.wxs(WiX v5) is a dual-scope package (Microsoft "Single Package Authoring"): it installs per-user by default, without a UAC prompt, into%LOCALAPPDATA%\Programs\ArtCraft\PhotoCraft(Windows Installer redirects the ProgramFiles folder in a per-user install); the setup wizard's "Everyone on this computer" option, ormsiexec ... ALLUSERS=1, installs per-machine intoProgram Files\ArtCraft\PhotoCraft(Program Files (x86)for the 32-bit build). It installs an advertised Start Menu shortcut associated with thePhotocraftExefile component. PhotoCraft becomes the default app for.pcraftand is listed under "Open with" for PSD/PSB and image files (in a per-user install those registrations and theInstallDirrecord live under HKCU instead of HKLM; the package's registry roots follow the context automatically). It also registers App Paths (Win+Rphotocraft). An install updates the copy registered in its own context; installing in the other context while a copy already exists is stopped with a message, not a silent duplicate (a scope change needs an explicit uninstall first). The MSI version is the numericX.Y.Z, because MSI has no pre-release field. Same-version upgrades are allowed so that release candidates replace each other. -
Double-clicking the MSI opens a setup wizard (WixUI_InstallDir without the licence page; the scope page appears only for a new full-UI install, not for maintenance, uninstall or reduced and silent runs): a scope page ("Only for me" or "Everyone on this computer"), Welcome, the install folder (remembered for upgrades in
HKLMorHKCU\Software\PhotoCraft\InstallDiraccording to context), Ready, a progress page, and a Finish page that says where to find the app, with a ticked "Launch PhotoCraft" box. The pages name the full version (photocraft.en-us.wxl).package.ps1draws the wizard's banner and side bitmaps from the app icon, so no WiX stock art ships.msiexec /qninstalls a new product silently per-user unlessALLUSERS=1is passed. Maintenance keeps the existing installation context, and a major upgrade of an existing per-machine installation withoutALLUSERS=1is rejected rather than installed per-user. Building needs the WiX UI and Util extensions:wix extension add -g WixToolset.UI.wixext/5.0.2 WixToolset.Util.wixext/5.0.2. -
Shortcut icon identifiers keep the executable's
.exeextension: MSI uses the identifier as the cached icon filename, and an extensionless filename can render as a blank document icon.packaging/windows/check-icons.ps1checks the references and extensions in CI;package.ps1also validates the built MSI with ICE50 before signing it. -
Portable zip: it ships
packaging/windows/portable.txtbesidephotocraft.exe. That marker (or aPhotoCraft.portablefile) switches on portable mode: preferences, presets, recovery autosaves and the GPU startup marker go toPhotoCraftData\next to the exe instead of%APPDATA%\Photocraft. If that folder isn't writable the app warns and uses%APPDATA%. The MSI has no marker. The logic is inapps/photocraft/src/app_dirs.rsand works the same on macOS and Linux. -
Symbols zip:
photocraft.pdbandphotocraft_cli.pdbfrom the same release build, pluspackaging/windows/symbols.txt(how to load them in a profiler). An optional download, so the MSI and portable zip stay their size; it lets anyone profile the released exes with function names (#688). Only that build's PDBs match its exes, so they can't be rebuilt later; the release profile has no line tables, so they carry function names, not source lines. -
Signing:
packaging/windows/sign.ps1signs both.exefiles and then the.msiwithsigntool, using SHA-256 and an RFC 3161 timestamp. It uses whichever material is present:- a
.pfxfile (WINDOWS_CERTIFICATE,WINDOWS_CERTIFICATE_PASSWORD), timestamped by DigiCert, or - Azure Trusted Signing (
AZURE_*): the script downloads theMicrosoft.Trusted.Signing.Clientdlib and timestamps with Microsoft's server. The package is pinned to a version and SHA-256 at the top ofsign.ps1and refused on a mismatch, so an upgrade is a deliberate change to both.
The script is the single place to change when the Windows signing setup changes.
- a
Locally on Windows: dotnet tool install -g wix --version 5.0.2,
wix extension add -g WixToolset.UI.wixext/5.0.2 WixToolset.Util.wixext/5.0.2, then
pwsh packaging/windows/package.ps1 -Arch x64.
Linux
packaging/linux/package.sh stages one FHS tree and makes every format from it. The tree
holds both binaries, ai.storyteller.photocraft.desktop, hicolor icons from 16 px to 512 px
plus a scalable SVG, AppStream metainfo, a shared-mime-info file for .pcraft, .psb and
.qoi, and photocraft-cli's man pages and bash, zsh and fish completions. The
man-and-completions example, built with the binaries, writes those; a cross build runs it
through EMULATOR and leaves them out without one. The zsh completion is in
/usr/share/zsh/site-functions, which Fedora's and openSUSE's zsh read; the .deb also links it
from /usr/share/zsh/vendor-completions, which Debian's zsh reads instead.
Why these formats:
-
AppImage runs on any distribution without installing anything. The download-and-go option and the fallback for distros the packages don't cover. It's built with the maintained
AppImage/appimagetool, whose static runtime doesn't need libfuse2. The packaging script verifies pinned AppImageTool 1.9.1 and type2 runtime 20251108 binaries. For an offline build, pre-seed$CARGO_TARGET_DIR/appimagetool-1.9.1-$ARCH.AppImageand$CARGO_TARGET_DIR/type2-runtime-20251108-$ARCHwith the matching official release assets; the script checks both SHA-256 digests and makes the cached AppImageTool executable after verification; the runtime is only read as data. AnAPPIMAGETOOLoverride must point to that same verified AppImageTool binary and already be executable (chmod +xit before packaging). Each AppImage embeds update information (gh-releases-zsync|…|latest|…, #349) and ships with a.zsyncbeside it, so AppImageUpdate, AppImageLauncher and similar tools can find the next release and download only the blocks that changed. ItsAppRun(packaging/linux/AppRun) also integrates with the desktop on launch: on Wayland the dock icon comes from the compositor resolving the window's app_id against an installed.desktopfile, which an AppImage alone never provides — without this every AppImage run shows the generic Wayland logo (#593). Best effort: it installs~/.local/share/applications/ai.storyteller.photocraft.desktopwithExecrewritten to the AppImage's path (TryExecdropped, the binary isn't on the host PATH) and the hicolor icons beside it, rewriting only when the content changed, and any failure leaves the launch untouched. Launcher refresh uses a hidden generated snapshot to preserve user edits, comments and deleted keys while updating untouched packaged metadata and known executable paths. Missing or damaged snapshots use a conservative fallback. External integration removes a duplicate only when a regular launcher exactly matches a valid regular snapshot. Symlinked launchers or snapshots (including dangling links) and special files are left alone during both refresh and deduplication; icons still install. These checks do not synchronize concurrent changes by other processes. This overlaps the deduplication protection proposed in #5168 without depending on it.PHOTOCRAFT_NO_DESKTOP_INTEGRATION=1opts out; to uninstall,rm ~/.local/share/applications/ai.storyteller.photocraft.desktopandfind ~/.local/share/icons/hicolor -name 'ai.storyteller.photocraft*' -delete. The script is covered bypackaging/linux/apprun-test.shin the packaging-lint workflow. A leading--clilaunches the bundledusr/bin/photocraft-cli, without desktop integration:./photocraft-<version>-linux-x86_64.AppImage --cli mcpserves MCP on stdio. A symlink namedphotocraft-clialso selects that binary via the runtime'sARGV0. Arguments and process streams pass through unchanged; the entry point usesexecso signals and exit status reach the caller directly. CLI routing is covered bypackaging/linux/apprun-cli-test.shin the same workflow. -
.deb covers Debian, Ubuntu, Mint, Pop!_OS and elementary. .rpm covers Fedora, RHEL and its clones, and openSUSE. Both integrate with the menu, MIME and icon caches (the
postinst.shhook) and uninstall cleanly. Both are built by nfpm: one maintained, dependency-free tool and one config (nfpm.yaml). It doesn't need cargo-deb and cargo-generate-rpm metadata in our crates, and it can build both formats on Ubuntu. -
.tar.gz is for people who manage their own
/optor~/.local. -
Flatpak bundle (
.flatpak) is a single file that installs into Flatpak, sandboxed and updatable by installing a newer bundle, for people who prefer Flatpak to AppImage.packaging/linux/flatpak-bundle.shrepackages the job's.tar.gzwithpackaging/linux/flatpak/ai.storyteller.photocraft.bundle.ymlon the freedesktop 26.08 runtime. It does no Rust build and needs no network insideflatpak-builder, so the bundle holds the same binaries as the other formats. A separateflatpakjob per architecture (ubuntu-24.04andubuntu-24.04-arm, for flatpak-builder 1.4) downloads the Linux job's artifact, runs the script, installs the bundle and runsphotocraft-cli --versioninside the sandbox as a smoke test. The bundle names Flathub as its runtime repo, so users install it with:flatpak install --user photocraft-<v>-linux-x86_64.flatpak # pulls org.freedesktop.Platform//26.08 from Flathub if missing flatpak run ai.storyteller.photocraftSandbox permissions (justified in the manifest): Wayland with X11 fallback, IPC (X11 shared memory),
drifor the GPU, the CUPS socket, Avahi and~/.cups(read-only) for printing, and read/write access to Pictures and Documents. Every other file goes through the file-chooser and document portals. Network access enables update checks and makes the optional loopback--controlserver reachable from the host. Host fonts are read from/run/host/fontsand/run/host/user-fonts. Locally (on Linux, withflatpakandflatpak-builder):packaging/linux/package.sh --formats tar && packaging/linux/flatpak-bundle.sh. -
Flathub:
packaging/linux/flatpak/ai.storyteller.photocraft.ymlbuilds from source and is ready for a Flathub submission (it keeps the same runtime andfinish-argsas the bundle manifest, which packaging-lint checks). CI doesn't build it. A real build needs vendored crate sources (cargo-sources.jsonfromflatpak-cargo-generator.py) and adds 20+ minutes per architecture. Build it by hand with the commands in the manifest's header.
All Linux binaries are built on Ubuntu 22.04 and need glibc ≥ 2.35: Ubuntu 22.04+,
Debian 12+, Fedora 36+, RHEL 10, openSUSE Tumbleweed. They link only glibc and libgcc_s. X11,
Wayland, xkbcommon, Vulkan and EGL are loaded at runtime from the system, which is also where
the GPU driver has to come from. That's why the .deb and .rpm declare them as dependencies
(the full list, and why each is there, is in packaging/linux/nfpm.yaml) and the AppImage
doesn't bundle them. The Flatpak gets them from the freedesktop runtime. Because the AppImage
and the tarball can't declare dependencies, photocraft checks for the libraries its session
(X11 or Wayland) needs before it opens a window (apps/photocraft/src/linux_libs.rs) and, if
one is missing, prints the package to install and exits with status 1 instead of crashing.
PHOTOCRAFT_SKIP_LIB_CHECK=1 skips the check.
Locally (on Linux): install nfpm, then
packaging/linux/package.sh (or --formats "deb tar").
Packaged automation and offline documentation
Both Flatpak manifests install photocraft-cli, alongside the GUI. To start the stdio MCP
server with a project in the sandbox's allowed Documents directory:
flatpak run --command=photocraft-cli ai.storyteller.photocraft mcp \
--automation-read-root "$HOME/Documents/project" \
--automation-write-root "$HOME/Documents/project"
The automation roots restrict PhotoCraft's file access; they do not grant Flatpak access to
other host directories. For a project elsewhere, also grant that directory with Flatpak's
--filesystem=/absolute/project run option. Stdio MCP needs no network permission.
Linux packages include the original mcp.md and control-protocol.md for offline use:
| Format | Documentation directory |
|---|---|
.deb, .rpm |
/usr/share/doc/photocraft/ |
Extracted .tar.gz |
share/doc/photocraft/ inside the extracted release directory |
| Flatpak (source or bundle) | /app/share/doc/photocraft/ inside the sandbox |
| Extracted AppImage | squashfs-root/usr/share/doc/photocraft/ |
For example, read the Flatpak's MCP guide without opening the GUI:
flatpak run --command=cat ai.storyteller.photocraft /app/share/doc/photocraft/mcp.md
To read an AppImage's guides, run ./PhotoCraft.AppImage --appimage-extract in a directory
where you want its squashfs-root contents, using the downloaded file's actual name. Then
open either guide in squashfs-root/usr/share/doc/photocraft/. Extraction is an explicit user
action; launching the app does not extract documentation into the home directory. These two
Markdown files are included as written; links to other repository documents still need a
checkout or the online documentation.
bash packaging/linux/package-docs-test.sh checks the real Linux staging/tar commands,
AppDir retention and both Flatpak manifests' install commands with fixture binaries and
stubbed AppImage tooling. Packaging lint runs it through extra-checks-script; it does not
compile Rust, build a real AppImage, or run a Flatpak sandbox.
FreeBSD
GitHub has no FreeBSD runners, so the freebsd job runs packaging/freebsd/package.sh in a
FreeBSD 14.3 VM (vmactions/freebsd-vm, pinned by commit), with the same packages as the
FreeBSD CI workflow (.github/workflows/freebsd.yml) plus bash. The script builds both
binaries with CARGO_BUILD_JOBS=4 (more runs the 12 GB VM out of memory) and writes
photocraft-<v>-freebsd-x86_64.tar.gz. FreeBSD's uname -m says amd64; the file name uses
x86_64 like the other artifacts. The tarball is a /usr/local-style tree: bin/photocraft,
bin/photocraft-cli, and under share/ the same desktop entry, MIME type, AppStream metainfo
and hicolor icons as Linux, plus the licences, NOTICE and ATTRIBUTION.md in
share/doc/photocraft/, and photocraft-cli's man pages (man/man1/) and bash, zsh and fish
completions (share/bash-completion, share/zsh/site-functions, share/fish), written by the
man-and-completions example built with the binaries. Users install it with:
pkg install libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader gtk3 fontconfig freetype2 alsa-lib
tar -xzf photocraft-<v>-freebsd-x86_64.tar.gz --strip-components 1 -C /usr/local
The job signs nothing, so it runs outside the release environment and gets no secrets. The
version, build date and commit reach the VM through the action's envs: (by name, never
templated into the script), and the build happens in /var/tmp so only dist/ is copied back
out of the VM. The binaries aren't signed: FreeBSD has no code-signing scheme for loose
binaries, so check the tarball against SHA256SUMS.txt.
The FreeBSD CI workflow runs the same script after its build and test (on pushes to main, and
on PRs that touch packaging/freebsd/, freebsd.yml or release.yml), so the release job
isn't the first place it runs. Locally, on any OS, packaging/freebsd/package.sh --dry-run stages the tree from stub binaries
and lists the tarball, which checks the layout without a FreeBSD machine.
Web
packaging/web/package.sh runs trunk build --release for the app (apps/photocraft-web, into
dist/web) and for the module that starts it (apps/photocraft-web-boot, into dist/web-boot).
It gzips the app's wasm, cuts it into parts of at most 20 MiB and zips the boot module's page with
the parts, sample _headers and .htaccess files and the hosting guide. The site only uses
relative URLs, so it works under any path and in an iframe. The wasm builds with the
size-optimized wasm-release Cargo profile (set in apps/photocraft-web/index.html), and the
script fails if any file in the site exceeds 24 MiB, below Cloudflare's 25 MiB per-file limit;
the app's wasm itself may be larger, since it ships as parts.
packaging/web/README.md covers MIME types, compression,
caching, the iframe snippet and the ?webgl / ?cpu flags.
Secrets
All secrets live in the repository's release environment (Settings → Environments →
release). Restrict its deployment branches to release and the nightly signer's
nightly-signer. Every job in the shared stable release.yml that signs or publishes binds the
environment only for a non-dry run on refs/heads/release (the Flatpak and FreeBSD jobs sign
nothing and don't), so only stable runs on that branch, or the pinned nightly signer on
nightly-signer, can read the secrets. Each secret is optional. If one is missing, that platform's artifacts are unsigned and
the run shows a ::warning::.
| Secret | Used for |
|---|---|
APPLE_CERTIFICATE |
base64 .p12 with "Developer ID Application: Learning Machines LLC (DJ6XS33FX8)" |
APPLE_CERTIFICATE_PASSWORD |
password for that .p12 |
KEYCHAIN_PASSWORD |
password for the temporary CI keychain (random if unset) |
APPLE_ID |
Apple ID used by notarytool |
APPLE_PASSWORD |
app-specific password for that Apple ID |
APPLE_TEAM_ID |
DJ6XS33FX8 |
WINDOWS_CERTIFICATE |
base64 .pfx code-signing certificate |
WINDOWS_CERTIFICATE_PASSWORD |
password for that .pfx |
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET |
service principal for Azure Trusted Signing (an alternative to the .pfx) |
AZURE_SIGNING_ENDPOINT |
e.g. https://eus.codesigning.azure.net |
AZURE_SIGNING_ACCOUNT, AZURE_CERT_PROFILE |
Trusted Signing account and certificate profile names |
GITHUB_TOKEN creates the release. Only the final job gets contents: write.
On macOS, packaging/macos/import-cert.sh decodes the .p12 into a temporary keychain
(security create-keychain, then security import, then set-key-partition-list so codesign
can use the key without a prompt). It exports the identity's SHA-1 as MACOS_SIGN_IDENTITY.
The keychain is deleted at the end of the job.
Icons
assets/app-icon/photocraft.svg is the canonical icon: the owner's ArtCraft drawing of a
nine-tailed kitsune, vectorised (MIT OR Apache-2.0, see LICENSE.txt there; palette and
geometry in README.md). packaging/icons.sh regenerates the 1024 px PNG, the .icns, the .ico (packed by
cargo xtask ico) and the hicolor PNGs from it. It needs resvg, plus iconutil on macOS.
The outputs are committed, so packaging never needs those tools.
Checks
.github/workflows/packaging-lint.yml runs in seconds on any change to packaging/, the
workflows or the icons. It runs actionlint, shellcheck, a PowerShell parse, xmllint,
desktop-file-validate, appstreamcli validate, and a YAML check that the two Flatpak
manifests agree on the runtime and permissions.