-
Notifications
You must be signed in to change notification settings - Fork 49
337 lines (332 loc) · 13.2 KB
/
snapcraft8_builds.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
name: Checkbox Snapcraft8 builds
on:
workflow_dispatch:
workflow_call:
jobs:
snap_runtime_native:
strategy:
fail-fast: false
matrix:
releases: [18, 20, 22, 24]
arch: [amd64, arm64]
include:
- arch: amd64
tag: X64
- arch: arm64
tag: ARM64
- releases: 18
snapcraft_version: 7.x
- releases: 20
snapcraft_version: 7.x
- releases: 22
snapcraft_version: 8.x
- releases: 24
snapcraft_version: 8.x
runs-on:
group: "Canonical self-hosted runners"
labels:
- self-hosted
- linux
- jammy
- large
- ${{ matrix.tag }}
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
env:
SERIES: series${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
name: Runtime ${{ matrix.releases }} (${{matrix.arch}})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy over the common files for series ${{ matrix.releases }}
run: |
cd checkbox-core-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./prepare.sh $SERIES
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "robot@lists.canonical.com"
git config --global user.name "Certification bot"
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Build the snap
timeout-minutes: 600 # 10hours
with:
action: snapcore/action-build@v1.3.0
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
path: checkbox-core-snap/series${{ matrix.releases }}
snapcraft-channel: ${{ matrix.snapcraft_version }}/stable
- uses: actions/upload-artifact@v4
name: Upload logs on failure
if: failure()
with:
name: snapcraft-log-series${{ matrix.releases }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox-core-snap/series${{ matrix.releases }}/checkbox*.txt
- uses: actions/upload-artifact@v4
name: Upload the snap as artifact
with:
name: checkbox${{ matrix.releases }}_${{ matrix.arch }}
path: checkbox-core-snap/series${{ matrix.releases }}/*.snap
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Upload the snap to the store
timeout-minutes: 600 # 10hours
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox-core-snap/series${{ matrix.releases }}/*.snap ; \
do \
echo "Uploading $snap..." ; \
snapcraft upload $snap --release edge ; \
done
snap_frontend_native:
strategy:
fail-fast: false
matrix:
type: [classic, uc]
releases: [18, 20, 22, 24]
arch: [amd64, arm64]
include:
- arch: amd64
tag: X64
- arch: arm64
tag: ARM64
- releases: 18
snapcraft_version: 7.x
- releases: 20
snapcraft_version: 7.x
- releases: 22
snapcraft_version: 8.x
- releases: 24
snapcraft_version: 8.x
runs-on:
group: "Canonical self-hosted runners"
labels:
- self-hosted
- linux
- jammy
- large
- ${{ matrix.tag }}
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
env:
SERIES: series_${{ matrix.type }}${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
name: Frontend ${{ matrix.type }}${{ matrix.releases }} (${{matrix.arch}})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy over the common files for series ${{ matrix.type }}${{ matrix.releases }}
run: |
cd checkbox-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./prepare_${{ matrix.type }}.sh $SERIES
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "robot@lists.canonical.com"
git config --global user.name "Certification bot"
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Building the snaps
timeout-minutes: 600 # 10hours
with:
action: snapcore/action-build@v1.3.0
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}
snapcraft-channel: ${{ matrix.snapcraft_version }}/stable
- uses: actions/upload-artifact@v4
name: Upload logs on failure
if: failure()
with:
name: snapcraft-log-series-${{ matrix.type }}${{ matrix.releases }}${{ matrix.arch }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/checkbox*.txt
- uses: actions/upload-artifact@v4
name: Upload the snaps as artefacts
with:
name: series_${{ matrix.type }}${{ matrix.releases }}${{ matrix.arch }}
path: checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Upload the snaps to the store
timeout-minutes: 600 # 10hours
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox-snap/series_${{ matrix.type }}${{ matrix.releases }}/*.snap ; \
do \
echo "Uploading $snap..." ; \
if [ ${{ matrix.type }} = 'classic' ]; then \
if [ ${{ matrix.releases }} = '22' ]; then \
snapcraft upload $snap --release ${{ matrix.releases }}.04/edge,latest/edge ; \
else \
snapcraft upload $snap --release ${{ matrix.releases }}.04/edge ; \
fi \
else \
snapcraft upload $snap --release ${{ matrix.type }}${{ matrix.releases }}/edge ; \
fi ; \
done
snap_runtime_remote_build:
strategy:
fail-fast: false
matrix:
releases: [22, 24]
arch: [armhf]
runs-on: [self-hosted, linux, jammy, large]
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
env:
SERIES: series${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
# snapcraft remote-build will create a repository with the name decided by the --build-id arg
# URL to this repo echoed below to help debug builds (does not change if the workflow is re-run)
SNAPCRAFT_BUILDER_ID: checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}
name: Runtime ${{ matrix.releases }} (${{ matrix.arch }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "robot@lists.canonical.com"
git config --global user.name "Certification bot"
- name: Copy over the common files for series ${{ matrix.releases }}
run: |
cd checkbox-core-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./snapcraft8_prepare.sh $SERIES
git add ..
git commit -m "Prepared build"
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Build the snap
timeout-minutes: 600 # 10hours
with:
action: snapcore/action-build@v1.3.0
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
snapcraft-channel: 8.x/stable
snapcraft-args: remote-build --build-for ${{ matrix.arch }} --launchpad-accept-public-upload --build-id "checkbox${{ matrix.releases }}-${{ matrix.arch }}-${{ github.run_id }}" --launchpad-timeout=36000
- uses: actions/upload-artifact@v4
name: Upload logs on failure
if: failure()
with:
name: runtime-build-log-${{ matrix.releases }}-${{ matrix.arch }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox*.txt
- uses: actions/upload-artifact@v4
name: Upload the snap as artifact
with:
name: runtime_snap${{ matrix.releases }}_${{ matrix.arch }}
path: "checkbox*.snap"
- uses: Wandalen/wretry.action@v3.4.0_js_action
name: Upload the snap to the store
timeout-minutes: 600 # 10hours
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox*.snap ; \
do \
echo "Uploading $snap..." ; \
snapcraft upload $snap --release edge ; \
done
snap_frontend_remote_build:
strategy:
fail-fast: false
matrix:
type: [classic, uc]
releases: [22, 24]
arch: [armhf]
runs-on: [self-hosted, linux, jammy, large]
timeout-minutes: 1200 #20h, this will timeout sooner due to inner timeouts
env:
SERIES: series_${{ matrix.type }}${{ matrix.releases }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
# snapcraft remote-build will create a repository with the name decided by the --build-id arg
# URL to this repo echoed below to help debug builds (does not change if the workflow is re-run)
# as the run_id will not change
SNAPCRAFT_BUILDER_ID: checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ github.run_id }}
name: Frontend ${{ matrix.type }}${{ matrix.releases }} (${{ matrix.arch }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add LP credentials
run: |
mkdir -p ~/.local/share/snapcraft/
echo '${{ secrets.LP_CREDS }}' > ~/.local/share/snapcraft/launchpad-credentials
git config --global user.email "robot@lists.canonical.com"
git config --global user.name "Certification bot"
- name: Copy over the common files for series ${{ matrix.type }}${{ matrix.releases }}
run: |
cd checkbox-snap/
sudo apt update && sudo apt install -qq -y python3-setuptools-scm
./snapcraft8_prepare_${{ matrix.type }}.sh $SERIES
git add ..
git commit -m "Prepared build"
- name: Print Launchpad build repository
run: |
echo "Building at: https://git.launchpad.net/~ce-certification-qa/+snap/$SNAPCRAFT_BUILDER_ID"
- uses: Wandalen/wretry.action/main@v3.4.0_js_action
name: Building the snaps
timeout-minutes: 600 # 10hours
with:
action: snapcore/action-build@v1.3.0
attempt_delay: 600000 # 10min
attempt_limit: 5
with: |
snapcraft-channel: 8.x/stable
snapcraft-args: remote-build --build-for ${{ matrix.arch }} --launchpad-accept-public-upload --build-id "checkbox-${{ matrix.type }}${{ matrix.releases }}-${{ github.run_id }}" --launchpad-timeout=36000
- uses: actions/upload-artifact@v4
name: Upload logs on failure
if: failure()
with:
name: frontend-build-log-${{ matrix.type }}${{ matrix.releases }}
path: |
/home/runner/.cache/snapcraft/log/
/home/runner/.local/state/snapcraft/log/
checkbox*.txt
- uses: actions/upload-artifact@v4
name: Upload the snaps as artefacts
with:
name: frontend_snaps${{ matrix.type }}${{ matrix.releases }}
path: "checkbox*.snap"
- uses: Wandalen/wretry.action/main@v3.4.0_js_action
name: Upload the snaps to the store
timeout-minutes: 600 # 10hours
with:
attempt_delay: 600000 # 10min
attempt_limit: 10
command: |
for snap in checkbox*.snap ; \
do \
echo "Uploading $snap..." ; \
if [ ${{ matrix.type }} = 'classic' ]; then \
if [ ${{ matrix.releases }} = '22' ]; then \
snapcraft upload $snap --release ${{ matrix.releases }}.04/edge,latest/edge ; \
else \
snapcraft upload $snap --release ${{ matrix.releases }}.04/edge ; \
fi \
else \
snapcraft upload $snap --release ${{ matrix.type }}${{ matrix.releases }}/edge ; \
fi ; \
done