generated from snapcrafters/snap-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (43 loc) · 1.56 KB
/
test-build-snap.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
# Build the snap on pull_request to ensure the snap is buildable before merge to main
#
# This workflow duplicates some of the logic from release-snap.yaml. If modifying this workflow,
# ensure that release-snap.yaml is also updated
name: Test Build Snap
on:
pull_request:
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
LAUNCHPAD_TOKEN: ${{ secrets.LAUNCHPAD_TOKEN }}
jobs:
build:
name: Build snap (${{ matrix.confinement }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
confinement: [ "strict", "classic" ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# snapcraft remote-build requires a full clone
fetch-depth: 0
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Install dependencies
run: |
sudo snap install --classic --channel edge snapcraft
# Setup Launchpad credentials
mkdir -p ~/.local/share/snapcraft
echo -e "$LAUNCHPAD_TOKEN" >> ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
- name: yq - portable yaml processor
uses: mikefarah/yq@v4
- if: ${{ matrix.confinement == 'classic' }}
name: Convert to Classic Snap
run: ./make-classic.sh
- name: Build Snap (remote)
run: snapcraft remote-build --launchpad-accept-public-upload