ci: add snap publishing workflow

This commit adds snap publishing and promotion to the CI process.

For nightly releases, upload the built snaps to the 'latest/edge'
channel, enabling users to track nightly builds with:

    snap install yazi --classic --channel latest/edge

For draft releases, upload the built snaps to the 'latest/candidate'
channel.

And finally, when a release is published, promote the snaps that
are in the 'latest/candidate' channel to 'latest/stable'.
This commit is contained in:
Jon Seager 2025-03-03 17:06:11 +00:00
parent 3082cad16c
commit 0b366b7dc0
No known key found for this signature in database
2 changed files with 21 additions and 0 deletions

View file

@ -187,6 +187,14 @@ jobs:
with:
merge-multiple: true
- name: Push snap to latest/candidate channel
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
for x in *.snap; do
snapcraft push -v --release latest/candidate $x
done
- name: Draft
uses: softprops/action-gh-release@v1
with:
@ -221,6 +229,14 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag --force nightly && git push --force origin tag nightly
- name: Push snap to latest/edge channel
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
for x in *.snap; do
snapcraft push -v --release latest/edge $x
done
- name: Nightly
uses: softprops/action-gh-release@v1
with:

View file

@ -18,3 +18,8 @@ jobs:
identifier: sxyazi.yazi
installers-regex: 'yazi-(x86_64|aarch64)-pc-windows-msvc\.zip$'
token: ${{ secrets.WINGET_TOKEN }}
- name: Promote snap to latest/stable
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: snapcraft promote yazi --from-channel latest/candidate --to-channel latest/stable --yes