Skip to content

ci: add snap build and publish pipeline#1494

Open
zyga wants to merge 1 commit into
NVIDIA:mainfrom
zyga:snap/build-pipeline
Open

ci: add snap build and publish pipeline#1494
zyga wants to merge 1 commit into
NVIDIA:mainfrom
zyga:snap/build-pipeline

Conversation

@zyga
Copy link
Copy Markdown
Contributor

@zyga zyga commented May 21, 2026

Summary

Add GitHub snap build, test (when spread support is merged) and publishing pipeline.

Related Issue

N/A

Changes

This branch is an adaptation of my https://github.com/zyga/hello-rust project that was developed for allowing GitHub based projects to use the snap store without having to grant individual developers collaborator status on the snap.

The main entrypoing is

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)
  • I smoke tested this on my fork (except for publishing for real)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Introduce a complete snap build, test, and publish workflow:

- install-cached-snap action: reusable composite action that downloads and
  installs snaps with GitHub Actions caching support. Handles snap components,
  classic mode, and cache miss cleanup with full artifact discovery.

- snapcraft-pack.yml: builds the snap for amd64 and arm64 architectures.
  Installs snapd, core22, core24, LXD, and snapcraft with configurable
  channels and optional caching. Captures snap and component filenames as
  workflow outputs and uploads them as build artifacts.

- spread.yml: runs integration tests using the spread test framework with
  image-garden for VM-based testing. Supports configurable spread systems,
  architectures, variants, and live mode. Caches pristine and prepared VM
  images separately.

- tasteful-crafts.yml: master reusable workflow that orchestrates the full
  pipeline — discovers spread systems via spread.yaml, packs for both
  amd64 and arm64, runs spread smoke tests on the amd64 build, then uploads
  all artifacts to the Snap Store. Supports skip-spread-tests for manual
  approval gates and environment-based channel targeting.

- snapcraft-build-test-publish.yml: entry-point workflow triggered on push
  to main, tag, or manual dispatch. Routes tag builds to latest/candidate
  and branch builds to latest/edge (or $SNAPCRAFT_CHANNEL). Includes
  workflow_dispatch input to skip spread tests and publish directly.

- snapcraft-promote.yml: manual workflow for promoting snap revisions from
  one Snap Store channel to another (e.g., candidate to stable). Requires
  a GitHub environment matching the target channel name with
  SNAPCRAFT_STORE_CREDENTIALS.

Depending on the workflow trigger (push or tag), one of two jobs runs:
one for uploading and releasing untagged builds to latest/edge, and another
for uploading tagged versions to latest/candidate.

Environment setup and Snap Store credentials are documented in
deploy/snap/PUBLISHING.md.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@zyga zyga requested review from a team, derekwaynecarr, maxamillion and mrunalp as code owners May 21, 2026 11:51
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 21, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@zyga zyga changed the title Snap/build pipeline ci: add snap build and publish pipeline May 21, 2026
@zyga
Copy link
Copy Markdown
Contributor Author

zyga commented May 22, 2026

Having seen what CI does in this PR I think the main question is exactly when to trigger the new logic. It surely should happen at some time, but given the special arrangement in this repository, I suspect you may want to think where exactly it fits.

@drew drew self-assigned this May 22, 2026
Comment on lines +9 to +10
pull_request:
branches: [ main ]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reminder to remove, we don't want this building on PRs.

Comment on lines +7 to +8
branches: [ main, snap/build-pipeline ]
tags: [ 'v*' ]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Starting a 🧵 for

main question is exactly when to trigger the new logic

Can we follow our current release strategy? Currently on push to main we publish a dev build, and on every vX.Y.Z tag we publish a tagged release.

We don't currently have the concept of a release candidate or promotion. Eventually we might want to add this, but right now we're optimizing for a fast release cadence.

It might be easier to keep snaps aligned with the current pattern, and then evolve our release strategy as a single unit from there.

@@ -0,0 +1,298 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: tasteful crafts
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is tasteful crafts? can we rename this to something more descriptive related to what is being done?

@drew
Copy link
Copy Markdown
Collaborator

drew commented May 22, 2026

I left some initial feedback, but I want to propose an alternative approach first. It seems like we're introducing new patterns for releasing artifacts (eg release candidates) and testing artifacts (eg spread). I want to make sure we don't fragment our codebase with different tools and patterns.

To that end, I would propose we start in this PR with something smaller scoped, and then step back and work on a larger release and testing strategy. This probably warrants an RFC and review w/ the broader community.

For this PR, let's start by adding snap builds to our existing release pipeline (see deb-package.yml and rpm-package.yml as examples) via a snap-package.yml workflow. We can publish a dev snap on push to main, and then a stable on every tagged release.

Instead of introducing spread, lets just add a test to the current release canary in .github/workflows/release-canary.yml. This will give us parity with our current release pipeline and get us onto the snap store.

Once that's in place, lets set up some time to review where we're at and come up with a more comprehensive plan as an RFC or series of Github issues. Spread looks promising and I wonder if we can use it for other release artifacts.

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