-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (52 loc) · 1.66 KB
/
snap-release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Release Snap is a composite workflow used within other workflows
# to reuse the logic of building and publishing a snap in one.
name: Release Snap
on:
workflow_call:
inputs:
folder:
required: true
type: string
release-channel:
required: true
type: string
secrets:
STORE_LOGIN:
required: true
# Note this workflow requires a Github secret to provide auth against snapstore.
# snapcraft export-login --snaps=PACKAGE_NAME --acls package_access,package_push,package_update,package_release exported.txt
# check this: https://github.com/snapcore/action-publish
jobs:
build:
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- run: git fetch --tags --force origin # https://github.com/actions/checkout/issues/882 & https://github.com/actions/checkout/issues/290
- name: Setup snap to build
run: |
mkdir -p ./snap
cp ./snaps/${{ inputs.folder }}/snapcraft.yaml ./snap/
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v4
with:
name: ${{ steps.snapcraft.outputs.snap }}
path: ${{ steps.snapcraft.outputs.snap }}
publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: ${{needs.build.outputs.snap}}
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{needs.build.outputs.snap}}
release: '${{ inputs.release-channel }}'