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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT

* snap smoke: quit the app cleanly between backends

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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

+2 -1
View File
@@ -32,7 +32,8 @@ old-name Pages addresses are not permanent aliases.
- **macOS 11+** (Apple silicon and Intel): open the `.dmg` and drag `SolidCraft.app` onto Applications.
The CLI is in `solidcraft-cli-{version}-macos-universal.zip`.
- **Linux** (x86_64 and aarch64, glibc 2.35+): the `.AppImage` (`chmod +x`, then run it), the
`.deb` or `.rpm`, the `.flatpak` (`flatpak install --user <file>`), or the `.tar.gz`.
`.deb` or `.rpm`, the `.flatpak` (`flatpak install --user <file>`), the `.snap`
(`sudo snap install --dangerous <file>`, or `sudo snap install solidcraft` from the Snap Store), or the `.tar.gz`.
- **FreeBSD:** `tar -xzf solidcraft-{version}-freebsd-x86_64.tar.gz --strip-components 1 -C /usr/local`.
- **Web:** `solidcraft-web-{version}.zip` is a static site to host yourself.
- `SHA256SUMS.txt`: `sha256sum -c SHA256SUMS.txt --ignore-missing`.
+2
View File
@@ -57,3 +57,5 @@ jobs:
sed -e 's/@VERSION@/0.0.0/' -e 's/@DATE@/2026-01-01/' packaging/linux/ai.storyteller.solvecraft.metainfo.xml.in >"$RUNNER_TEMP/ai.storyteller.solvecraft.metainfo.xml"
appstreamcli validate --no-net --explain "$RUNNER_TEMP/ai.storyteller.solvecraft.metainfo.xml"
python3 -c "import yaml; m = yaml.safe_load(open('packaging/linux/flatpak/ai.storyteller.solvecraft.bundle.yml')); assert m['id'] == 'ai.storyteller.solvecraft' and m['command'] == 'solidcraft'"
python3 -c "import yaml; m = yaml.safe_load(open('packaging/linux/snap/snapcraft.yaml')); assert m['name'] == 'solidcraft' and m['confinement'] == 'strict' and m['apps']['solidcraft']['command'] == 'usr/bin/solidcraft'"
python3 -m py_compile packaging/linux/snap-smoke.py
+84 -2
View File
@@ -6,7 +6,7 @@
# At midnight Eastern, changed main commits build and publish a nightly pre-release.
# A version with a suffix (0.2.0-rc.1) is a pre-release. Nothing is signed yet.
#
# Linux x86_64, aarch64 AppImage (+ .zsync), .deb, .rpm, .flatpak, .tar.gz packaging/linux
# Linux x86_64, aarch64 AppImage (+ .zsync), .deb, .rpm, .flatpak, .snap, .tar.gz packaging/linux
# FreeBSD x86_64 .tar.gz (built in a FreeBSD VM) packaging/freebsd
# macOS universal .dmg, and the CLI as a .zip packaging/macos
# Windows x64, x86, arm64 .msi and a portable .zip; x64 also the plain .exe packaging/windows
@@ -199,6 +199,59 @@ jobs:
snap:
name: Snap ${{ matrix.arch }}
needs: [version, linux]
if: needs.version.outputs.build == 'true'
# Repackages the Linux job's tarball, like the Flatpak. On 24.04 because the core24 base is
# Ubuntu 24.04, which lets snapcraft build on the runner itself (--destructive-mode).
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { arch: x86_64, runner: ubuntu-24.04 }
- { arch: aarch64, runner: ubuntu-24.04-arm }
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: release-linux-${{ matrix.arch }}
path: dist/linux
- name: Install snapcraft and the smoke-test tools
run: |
sudo snap install snapcraft --classic
sudo apt-get update
sudo apt-get install -y --no-install-recommends xvfb xauth weston dbus-x11
- name: Build the snap
run: |
sudo --preserve-env=SOLIDCRAFT_VERSION,SOLIDCRAFT_BUILD_DATE env "PATH=$PATH" \
packaging/linux/snap-pack.sh --destructive-mode "dist/linux/solidcraft-$SOLIDCRAFT_VERSION-linux-${{ matrix.arch }}.tar.gz"
sudo chown -R "$(id -u):$(id -g)" dist target
- name: Install it and start the app on headless X11 and Wayland
run: |
snap_file="dist/release/solidcraft-$SOLIDCRAFT_VERSION-linux-${{ matrix.arch }}.snap"
sudo snap install --dangerous "$snap_file"
snap info --verbose "$snap_file" | head -n 12
snap connections solidcraft
solidcraft.cli --version
# Snaps expect the login session's runtime directory, which runners don't create.
sudo install -d -m 700 -o "$(id -u)" -g "$(id -g)" "/run/user/$(id -u)"
python3 packaging/linux/snap-smoke.py --out snap-smoke
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: snap-smoke-${{ matrix.arch }}
path: snap-smoke/*.png
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-snap-${{ matrix.arch }}
path: dist/release/*.snap
if-no-files-found: error
freebsd:
name: FreeBSD x86_64
needs: version
@@ -337,7 +390,7 @@ jobs:
release:
name: GitHub Release or dry-run artifacts
needs: [version, linux, flatpak, freebsd, macos, windows, web]
needs: [version, linux, flatpak, snap, freebsd, macos, windows, web]
if: needs.version.outputs.build == 'true'
runs-on: ubuntu-latest
permissions:
@@ -425,6 +478,35 @@ jobs:
echo
sed 's/^/ /' SHA256SUMS.txt
} >>"$GITHUB_STEP_SUMMARY"
# Snap Store: nightlies go to the edge channel and release drafts to candidate, only after
# every package built and the GitHub release was staged. Publishing the GitHub release
# promotes candidate to stable (snap-store.yml). Dry runs never upload. Skipped until the
# owner adds the SNAPCRAFT_STORE_CREDENTIALS secret (docs/releasing.md).
- id: snapstore
name: Check for Snap Store credentials
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
if [ -n "$SNAPCRAFT_STORE_CREDENTIALS" ]; then
echo "configured=true" >>"$GITHUB_OUTPUT"
else
echo "No SNAPCRAFT_STORE_CREDENTIALS secret: skipping the Snap Store upload."
fi
- name: Upload the snaps to the Snap Store
if: >-
steps.snapstore.outputs.configured == 'true' && (github.event_name == 'schedule' ||
(github.ref == 'refs/heads/release' && (github.event_name == 'push' || inputs.draft)))
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
working-directory: artifacts
run: |
sudo snap install snapcraft --classic
channel=candidate
if [ "$GITHUB_EVENT_NAME" = schedule ]; then channel=edge; fi
for arch in x86_64 aarch64; do
snapcraft upload --release="$channel" "solidcraft-$VERSION-linux-$arch.snap"
done
echo "Uploaded the snaps to the Snap Store's $channel channel." >>"$GITHUB_STEP_SUMMARY"
- name: Keep the files (dry run)
if: github.event_name == 'workflow_dispatch' && !inputs.draft
run: cp notes.md artifacts/release-notes.md
+40
View File
@@ -0,0 +1,40 @@
# Publishing a GitHub release (not a prerelease) promotes the snaps that release.yml uploaded to
# the Snap Store's candidate channel to stable, so `sudo snap install solidcraft` gets it.
# Skipped until the owner adds the SNAPCRAFT_STORE_CREDENTIALS secret; see docs/releasing.md.
name: Snap Store
on:
release:
types: [released]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: snap-store
cancel-in-progress: false
jobs:
promote:
runs-on: ubuntu-latest
steps:
- id: creds
name: Check for Snap Store credentials
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
if [ -n "$SNAPCRAFT_STORE_CREDENTIALS" ]; then
echo "configured=true" >>"$GITHUB_OUTPUT"
else
echo "No SNAPCRAFT_STORE_CREDENTIALS secret: nothing to promote."
fi
- name: Promote candidate to stable
if: steps.creds.outputs.configured == 'true'
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
sudo snap install snapcraft --classic
snapcraft status solidcraft
snapcraft promote solidcraft --from-channel=latest/candidate --to-channel=latest/stable --yes
snapcraft status solidcraft