feat: add support for snap packages #531
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
snapcraft.yaml
is quite straightforward. I'll explain a little bit, in case you may want to change it in the future.On the top is various meta information, only things to be care are
grade
andconfinement
:devel
orstable
, defines the quality grade of the snap.strict
orclassic
, the latter means the snap have full system access just like traditionally applications.The packing process is defined in
parts
section.rust
plugin, and carry out withcraftctl default
. You may replace it with any custom build commands.craftctl set version=...
is used to set the version info.current only
fd-find
,ripgrep
,zoxide
,fzf
are boundle with yazi, these may need to be change with requirements.As for the release workflow, I did not add new matrix, current build is take place on
x86_64-unknown-linux-gnu
withsnapcore/action-build@v1
. The release file would beyazi*.snap
.The snap package can be install with
sudo snap install <package.snap> --dangerous --classic
Finally, to make it easier for users to get future updates, the snap can be publish to snap store. Snapcraft also provide its own build service to automatic build and release snaps.