Closed johnlettman closed 10 months ago
Ultimately, if/when this is merged, I will have a follow-up PR to implement a GitHub workflow to automatically publish master
to Snap Store so it doesn't add any development steps.
The worst amount of labor is setting a repository secret AFAIK.
Ultimately, if/when this is merged, I will have a follow-up PR to implement a GitHub workflow to automatically publish
master
to Snap Store so it doesn't add any development steps.
@johnlettman this can be handled with a webhook directly by the Snap Store, btw: https://snapcraft.io/build
@Saviq Oh, now that's pretty slick. TIL and thank you!
@dburkart I agree the Build from GitHub service mentioned by @Saviq is the most sensible approach as it will offload the build minutes from your runners. https://snapcraft.io/docs/build-from-github
The steps boil down to:
After that, the build service will take over, using the snapcraft.yaml
file in the repo to continuously integrate new commits and merges.
Perf! Works:
$ snap install --edge check-sieve
check-sieve (edge) 0.8 from Dana Burkart (dburkart) installed
$ which check-sieve
/snap/bin/check-sieve
$ check-sieve ~/repos/mail-sieves/sieves/00-advertisements.sieve
/home/jlettman/repos/mail-sieves/sieves/00-advertisements.sieve: No errors found!
$ snap info check-sieve
name: check-sieve
summary: Syntax checker for mail sieves
publisher: Dana Burkart (dburkart)
store-url: https://snapcraft.io/check-sieve
contact: XXXXX
license: MIT
description: |
Makes checking mail sieve syntax easy and painless. Because breaking your sieve in production
sucks.
commands:
- check-sieve
snap-id: QYVTYrffsi2KQMRa5FTQn32Y4K34CW4o
tracking: latest/edge
refresh-date: today at 15:28 EDT
channels:
latest/stable: –
latest/candidate: –
latest/beta: –
latest/edge: 0.8 2023-09-04 (1) 143kB -
installed: 0.8 (1) 143kB -
This pull request implements a Snapcraft definition for the check-sieve application as an alternative distribution and packaging method. Snaps are one of the many handy and portable ways of targeting several Linux distributions simultaneously for consumption.
The definition overrides the
pull
strategy to extract the version information from the last tag automatically. When the version is not published, it will jump to that tag for the build (e.g.,8.0
); otherwise, it will produce a build tagged with the commit identifier (e.g.,704d7c2
). The override suits CI/CD and automated GitHub workflow publishing.Lastly, the package is fairly lightweight:
The executable itself:
ls -lh check-sieve
The snap:
$ ls -lh check-sieve_v0.8_amd64.snap
This arises, most likely, from the compression and high optimization flags.
Example
$ snap info check-sieve
(*) follow-up commit will fix license metadata
$ rcat test.sieve
$ /snap/bin/check-sieve test.sieve