Skip to content

Commit 2d210ae

Browse files
jnsgruksxyazi
andcommitted
ci: add snap publishing workflow (#2435)
Co-authored-by: sxyazi <[email protected]>
1 parent 3082cad commit 2d210ae

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/draft.yml

+26
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,29 @@ jobs:
232232
name: Nightly Build
233233
body: ${{ env.NIGHTLY_BODY }}
234234
target_commitish: ${{ github.sha }}
235+
236+
snap:
237+
runs-on: ubuntu-latest
238+
needs: [build-snap]
239+
steps:
240+
- uses: actions/download-artifact@v4
241+
with:
242+
pattern: yazi-*.snap
243+
merge-multiple: true
244+
245+
- name: Setup snapcraft
246+
run: sudo snap install --classic snapcraft
247+
248+
- name: Push snap to candidate channel
249+
if: startsWith(github.ref, 'refs/tags/')
250+
env:
251+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
252+
run: |
253+
parallel 'snapcraft push -v --release latest/candidate {}' ::: yazi-*.snap
254+
255+
- name: Push snap to edge channel
256+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
257+
env:
258+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
259+
run: |
260+
parallel 'snapcraft push -v --release latest/edge {}' ::: yazi-*.snap

.github/workflows/publish.yml

+7
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,10 @@ jobs:
1818
identifier: sxyazi.yazi
1919
installers-regex: 'yazi-(x86_64|aarch64)-pc-windows-msvc\.zip$'
2020
token: ${{ secrets.WINGET_TOKEN }}
21+
22+
- name: Promote snap to stable
23+
env:
24+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
25+
run: |
26+
sudo snap install --classic snapcraft
27+
snapcraft promote yazi --from-channel latest/candidate --to-channel latest/stable --yes

0 commit comments

Comments
 (0)