Repository navigation
59 lines (51 loc) · 2.06 KB
/
Copy pathsnap.yml
File metadata and controls
59 lines (51 loc) · 2.06 KB
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
name: Snap Build
on:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- { runner: ubuntu-24.04, arch: amd64 }
- { runner: ubuntu-24.04-arm, arch: arm64 }
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup LXD
uses: canonical/setup-lxd@8c6a87bfb56aa48f3fb9b830baa18562d8bfd4ee # v1
- name: Install Snapcraft
run: |
# core24 + the `gnome` extension are fully supported by stable Snapcraft.
# (We moved off core26 because the gnome extension — required for GTK4 —
# does not support core26 yet; see snapcraft#6185 and RustConn#174.)
sudo snap install snapcraft --classic
snapcraft --version
- name: Build Snap
id: build
run: |
# The `gnome` extension pulls build-snaps (mesa-2404, gnome-46-2404-sdk)
# from the store during "Installing build-snaps". On the arm64 runner
# this intermittently fails with "Error installing snap 'mesa-2404'
# from channel 'latest/stable'" (transient store/network flakiness).
# Retry the whole pack a few times: snapcraft is incremental (no
# `clean`), so a retry only re-runs the failed build-snap install.
for attempt in 1 2 3; do
if snapcraft pack --verbose; then break; fi
[ "$attempt" = 3 ] && { echo "::error::snapcraft pack failed after 3 attempts"; exit 1; }
echo "::warning::snapcraft pack attempt $attempt failed (often a transient build-snap install error); retrying in 30s"
sleep 30
done
SNAP_FILE=$(ls *.snap)
echo "snap=$SNAP_FILE" >> $GITHUB_OUTPUT
echo "Built: $SNAP_FILE"
- name: Upload Snap artifact
uses: actions/upload-artifact@v6
with:
name: snap-${{ github.ref_name }}-${{ matrix.arch }}
path: ${{ steps.build.outputs.snap }}