Snap package: strict core24 snap on every release, optional Snap Store upload (#413)

* Snap package: build, test and attach a strict snap to every release

packaging/linux/snap/snapcraft.yaml (core24, strict, gnome extension) repackages
the release's Linux tarball like the Flatpak does. The release workflow builds it
for amd64 and arm64, installs it with --dangerous, models a box in the confined
app on headless X11 and Wayland, and attaches solidcraft-<version>-linux-<arch>.snap
plus the version-less copy. When SNAPCRAFT_STORE_CREDENTIALS is set, nightlies go
to edge and release drafts to candidate, and snap-store.yml promotes candidate to
stable when a release is published. The README gets a Snap badge and install line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT

* snap smoke: stop the app's whole process group, refuse a busy control port

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT

* snap smoke: quit the app cleanly between backends

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
bherbruckandClaude Opus 5.5 authored and GitHub committed 2026-10-12 18:07:26 -04:00
1 parent cddbfedb28
commit daed2686bc
10 files changed
+484 -4

No files matched your search

+16
View File
@@ -51,6 +51,22 @@ missing runtime. Launch with `flatpak run ai.storyteller.solvecraft`, rather tha
a host `solidcraft` binary. Files chosen through Open/Save use the desktop file-chooser portal;
command-line paths outside Documents may need a specific additional filesystem permission.
### Linux Snap
On Ubuntu and other distributions with snapd:
```sh
sudo snap install solidcraft
solidcraft # or open SolidCraft from the app menu
solidcraft.cli --version # the CLI, for scripts and `solidcraft.cli mcp`
```
The snap can open designs in your home folder (not hidden folders) and, through the file
chooser, anywhere else. For USB drives and other mounted disks, run
`sudo snap connect solidcraft:removable-media` once. A release's `.snap` file installs without
the store with `sudo snap install --dangerous ./solidcraft-VERSION-linux-ARCH.snap`; it then
doesn't update automatically.
## Web
The same app runs in the browser: [open SolidCraft on the web](../app/) (`?sample` opens the sample
+50 -1
View File
@@ -15,7 +15,7 @@ Every release asset, binary, installer product name and package uses the SolidCr
copies, the deprecated old-name CLI alias); keep them until that document says they can go. Do not
rewrite published assets, checksums, tags or historical release notes of earlier versions.
The main installers (`.msi`, portable `.zip`, `.dmg`, `.AppImage`, `.deb`, `.rpm`, `.flatpak`) are
The main installers (`.msi`, portable `.zip`, `.dmg`, `.AppImage`, `.deb`, `.rpm`, `.flatpak`, `.snap`) are
also attached without the version in their names, for example `solidcraft-windows-x64.msi` and
`solidcraft-linux-x86_64.AppImage`, and listed in `SHA256SUMS.txt`. The README's Download section
links to `https://github.com/bherbruck/solidcraft/releases/latest/download/<name>`, which follows
@@ -145,6 +145,55 @@ docs updates include the latest stable Flatpak release too. Verify the resulting
not only the dispatch job, so a release cannot erase the docs or app and docs updates cannot
erase the package repository.
## Snap package and Snap Store
Every release and nightly attaches `solidcraft-<version>-linux-<arch>.snap` for x86_64 and
aarch64 (`packaging/linux/snap-pack.sh`, manifest `packaging/linux/snap/snapcraft.yaml`). Like the
Flatpak, it repackages the Linux job's tarball. The `snap` job installs it with `--dangerous`,
starts the confined app on headless X11 and Wayland (`packaging/linux/snap-smoke.py`), models a
box over the control channel and keeps the captured frames as the `snap-smoke-<arch>` artifact.
The Snap Store steps run only when the `SNAPCRAFT_STORE_CREDENTIALS` repository secret exists;
without it they are skipped and the `.snap` files are still attached to the release:
- nightlies are uploaded to `latest/edge`;
- release drafts (pushes to `release`) are uploaded to `latest/candidate`, after every package
built and the draft was staged;
- publishing a non-prerelease GitHub release runs `snap-store.yml`, which promotes
`latest/candidate` to `latest/stable`. As with the Flatpak repository, a publication made with
`GITHUB_TOKEN` doesn't trigger it: then run `gh workflow run snap-store.yml`.
To enable the Snap Store once (owner):
1. Sign in at <https://snapcraft.io> with an Ubuntu One account and register the name at
<https://snapcraft.io/register-snap> (or `snapcraft login` then `snapcraft register solidcraft`).
2. On a machine with snapcraft (`sudo snap install snapcraft --classic`), export upload-only
credentials for this snap:
```sh
snapcraft export-login --snaps=solidcraft \
--channels=edge,candidate,stable \
--acls=package_access,package_push,package_update,package_release \
--expires=2027-10-01 solidcraft-store-credentials.txt
```
3. Store them as the repository secret and delete the file:
```sh
gh secret set SNAPCRAFT_STORE_CREDENTIALS -R bherbruck/solidcraft < solidcraft-store-credentials.txt
rm solidcraft-store-credentials.txt
```
4. Optional: fill in the store listing at <https://snapcraft.io/solidcraft/listing> (the icon,
summary and description come from the snap; add screenshots and the category "Art and design").
5. The next nightly fills `edge` and the next release fills `candidate`, then `stable` on
publication. To fill `stable` from an already published release right away, download its
`.snap` files and run `snapcraft upload --release=stable <file>` for each.
Renew the credentials before `--expires` by repeating steps 2 and 3. The snap uses strict
confinement and only plugs that connect automatically, apart from `removable-media`, which users
connect with `sudo snap connect solidcraft:removable-media` (getting-started.md).
## Repository setup
The `release` branch is advanced only for intentional release batches. Restrict its writers to