-
Notifications
You must be signed in to change notification settings - Fork 43
58 lines (50 loc) · 1.45 KB
/
create-snap-action.yml
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
58
name: Do a snap build of checkbox provider
run-name: ${{ github.actor }} is creating testing snap
on:
push:
branches:
- noble-24.04
paths:
- 'tests/**'
pull_request:
branches:
- noble-24.04
paths:
- 'tests/**'
workflow_dispatch: # Allow manual trigger
jobs:
check-secret:
runs-on: ubuntu-24.04
outputs:
snap-key: ${{ steps.snap-key.outputs.defined }}
steps:
- id: snap-key
name: Set defined=true if SNAPCRAFT7_CREDS is defined
if: "${{ env.SNAPSTORE_KEY != '' }}"
run: echo "defined=true" >> $GITHUB_OUTPUT
env:
SNAPSTORE_KEY: ${{ secrets.SNAPCRAFT7_CREDS }}
build:
runs-on: ubuntu-24.04
needs: [check-secret]
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: snapcore/action-build@v1
name: Build snap
id: build
with:
path: tests
snapcraft-channel: latest/stable
- name: Verify snap
run: |
sudo snap install checkbox24
sudo snap install --dangerous --classic ${{ steps.build.outputs.snap }}
- if: needs.check-secret.outputs.snap-key == 'true' && (github.ref_name == 'noble-24.04')
name: Publish snap to edge channel
uses: snapcore/[email protected]
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge