-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.95 KB
/
snap.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
59
60
61
62
63
64
65
name: Snap
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/snap.yml
- mir-ci/**
concurrency:
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }}
cancel-in-progress: true
jobs:
arches:
runs-on: ubuntu-24.04
outputs:
arches: ${{ steps.get-arches.outputs.arches }}
steps:
- id: get-arches
name: Determine which architectures to build for
run: |
ARCHES=( amd64 )
if ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}; then
ARCHES+=( armhf arm64 )
fi
jq --compact-output --null-input '$ARGS.positional' --args -- "${ARCHES[@]}" | awk '{ print "arches=" $0 }' >> $GITHUB_OUTPUT
checkbox-mir:
needs: [arches]
runs-on: ubuntu-24.04
timeout-minutes: 360
strategy:
fail-fast: false
matrix:
architecture: ${{ fromJSON(needs.arches.outputs.arches) }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
repository: canonical/checkbox-mir
fetch-depth: 0
- name: Use the current mir-ci commit
uses: mikefarah/yq@master
with:
cmd: yq -i '.parts.mir-ci.source-commit="${{ github.sha }}"' snap/snapcraft.yaml
- name: Disable LFS for remote-build pushes
run: |
git lfs uninstall
- name: Build and publish the snap
uses: canonical/actions/build-snap@release
with:
architecture: ${{ matrix.architecture }}
snapcraft-token: ${{ secrets.SNAPCRAFT_TOKEN }}
launchpad-credentials: ${{ secrets.LAUNCHPAD_CREDENTIALS }}
launchpad-accept-public-upload: true
publish: ${{ github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name }}
publish-channel: edge/mir-ci-pr${{ github.event.number }}