-
Notifications
You must be signed in to change notification settings - Fork 6
490 lines (398 loc) · 13.4 KB
/
release.yml
File metadata and controls
490 lines (398 loc) · 13.4 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
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
on:
push:
tags:
- v[0-9]+.*
- testing-ci.*
name: Build Packages
jobs:
build-deb:
name: Debian
runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- name: Install build dependencies
run: |
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
sed 's/^deb /deb-src /' /etc/apt/sources.list >> /etc/apt/sources.list
apt-get -q -y update
apt-get -q -y install build-essential debhelper debsigs fakeroot wget git meson \
python3-pyudev python3-pytest python3-libevdev ninja-build patch gpg cmake \
libevev-dev
apt-get -q -y build-dep libwacom libwacom-dev
- name: Checkout code
uses: actions/checkout@v4
- name: Build package
run: |
# Import GPG keys for libwacom/Peter Hutterer
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 3C2C43D9447D5938EF4551EBE23B7E70B467F0BF || true
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 594ABBA066118C7A02D10A80A8AF906D9307FBAD || true
# Set as safe directory for git
git config --global --add safe.directory "$PWD"
# Build packages using dpkg-buildpackage
./pkg/deb/makedeb
- name: Sign packages
env:
GPG_KEY_ID: 56C464BAAC421453
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
cd pkg/deb
# import GPG key
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
export GPG_TTY=$(tty)
# sign packages
for deb in *.deb; do
debsigs --sign=origin -k $GPG_KEY_ID "$deb"
done
- name: Prepare release
run: |
mkdir release
rm -f ./pkg/deb/*-dbgsym_*.ddeb || true
mv ./pkg/deb/*.deb release
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debian-latest
path: release
build-f43:
name: Build Fedora 43 package
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:43
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
dnf distro-sync -y
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
dnf builddep -y pkg/fedora/libwacom-surface.spec
- name: Build package
run: |
cd pkg/fedora
# Build the .rpm packages
./makerpm
- name: Sign packages
env:
GPG_KEY_ID: 56C464BAAC421453
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
cd pkg/fedora/out
# import GPG key
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
# sign package
cd noarch
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
cd ..
cd x86_64
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
- name: Prepare artifacts
run: |
cd pkg/fedora
mkdir release
cp out/noarch/* release/
cp out/x86_64/* release/
rm release/libwacom-surface-devel-*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fedora-43-latest
path: pkg/fedora/release
build-f42:
name: Build Fedora 42 package
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:42
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
dnf distro-sync -y
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
dnf builddep -y pkg/fedora/libwacom-surface.spec
- name: Build package
run: |
cd pkg/fedora
# Build the .rpm packages
./makerpm
- name: Sign packages
env:
GPG_KEY_ID: 56C464BAAC421453
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
cd pkg/fedora/out
# import GPG key
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
# sign package
cd noarch
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
cd ..
cd x86_64
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
- name: Prepare artifacts
run: |
cd pkg/fedora
mkdir release
cp out/noarch/* release/
cp out/x86_64/* release/
rm release/libwacom-surface-devel-*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fedora-42-latest
path: pkg/fedora/release
build-f41:
name: Build Fedora 41 package
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:41
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
dnf distro-sync -y
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
dnf builddep -y pkg/fedora/libwacom-surface.spec
- name: Build package
run: |
cd pkg/fedora
# Build the .rpm packages
./makerpm
- name: Sign packages
env:
GPG_KEY_ID: 56C464BAAC421453
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
cd pkg/fedora/out
# import GPG key
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
# sign package
cd noarch
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
cd ..
cd x86_64
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
- name: Prepare artifacts
run: |
cd pkg/fedora
mkdir release
cp out/noarch/* release/
cp out/x86_64/* release/
rm release/libwacom-surface-devel-*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: fedora-41-latest
path: pkg/fedora/release
release:
name: Publish release
needs: [build-deb, build-f43, build-f42, build-f41]
runs-on: ubuntu-latest
steps:
- name: Download Debian artifacts
uses: actions/download-artifact@v4
with:
name: debian-latest
path: debian-latest
- name: Download Fedora 43 artifacts
uses: actions/download-artifact@v4
with:
name: fedora-43-latest
path: fedora-43-latest
- name: Download Fedora 42 artifacts
uses: actions/download-artifact@v4
with:
name: fedora-42-latest
path: fedora-42-latest
- name: Download Fedora 41 artifacts
uses: actions/download-artifact@v4
with:
name: fedora-41-latest
path: fedora-41-latest
- name: Upload assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./*-latest/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
repo-deb:
name: Update Debian package repository
needs: [release]
runs-on: ubuntu-latest
container: debian:sid
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y git
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: debian-latest
path: debian-latest
- name: Update repository
env:
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
BRANCH_STAGING: u/staging
GIT_REF: ${{ github.ref }}
run: |
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
# clone package repository
git clone -b "${BRANCH_STAGING}" "${repo}" repo
# copy packages
cp debian-latest/* repo/debian/
cd repo/debian
# parse git tag from ref
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
# convert packages into references
for pkg in $(find . -name '*.deb'); do
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
rm $pkg
done
# set git identity
git config --global user.email "surfacebot@users.noreply.github.com"
git config --global user.name "surfacebot"
# commit and push
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
git switch -c "${update_branch}"
git add .
git commit -m "Update Debian libwacom"
git push --set-upstream origin "${update_branch}"
repo-f43:
name: Update Fedora 43 package repository
needs: [release]
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:43
options: --security-opt seccomp=unconfined
steps:
- name: Install dependencies
run: |
dnf install -y git findutils
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: fedora-43-latest
path: fedora-43-latest
- name: Update repository
env:
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
BRANCH_STAGING: u/staging
GIT_REF: ${{ github.ref }}
run: |
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
# clone package repository
git clone -b "${BRANCH_STAGING}" "${repo}" repo
# copy packages
cp fedora-43-latest/* repo/fedora/f43
cd repo/fedora/f43
# parse git tag from ref
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
# convert packages into references
for pkg in $(find . -name '*.rpm'); do
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
rm $pkg
done
# set git identity
git config --global user.email "surfacebot@users.noreply.github.com"
git config --global user.name "surfacebot"
# commit and push
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
git checkout -b "${update_branch}"
git add .
git commit -m "Update Fedora 43 libwacom"
git push --set-upstream origin "${update_branch}"
repo-f42:
name: Update Fedora 42 package repository
needs: [release]
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:42
options: --security-opt seccomp=unconfined
steps:
- name: Install dependencies
run: |
dnf install -y git findutils
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: fedora-42-latest
path: fedora-42-latest
- name: Update repository
env:
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
BRANCH_STAGING: u/staging
GIT_REF: ${{ github.ref }}
run: |
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
# clone package repository
git clone -b "${BRANCH_STAGING}" "${repo}" repo
# copy packages
cp fedora-42-latest/* repo/fedora/f42
cd repo/fedora/f42
# parse git tag from ref
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
# convert packages into references
for pkg in $(find . -name '*.rpm'); do
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
rm $pkg
done
# set git identity
git config --global user.email "surfacebot@users.noreply.github.com"
git config --global user.name "surfacebot"
# commit and push
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
git checkout -b "${update_branch}"
git add .
git commit -m "Update Fedora 42 libwacom"
git push --set-upstream origin "${update_branch}"
repo-f41:
name: Update Fedora 41 package repository
needs: [release]
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:41
options: --security-opt seccomp=unconfined
steps:
- name: Install dependencies
run: |
dnf install -y git findutils
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: fedora-41-latest
path: fedora-41-latest
- name: Update repository
env:
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
BRANCH_STAGING: u/staging
GIT_REF: ${{ github.ref }}
run: |
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
# clone package repository
git clone -b "${BRANCH_STAGING}" "${repo}" repo
# copy packages
cp fedora-41-latest/* repo/fedora/f41
cd repo/fedora/f41
# parse git tag from ref
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
# convert packages into references
for pkg in $(find . -name '*.rpm'); do
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
rm $pkg
done
# set git identity
git config --global user.email "surfacebot@users.noreply.github.com"
git config --global user.name "surfacebot"
# commit and push
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
git checkout -b "${update_branch}"
git add .
git commit -m "Update Fedora 41 libwacom"
git push --set-upstream origin "${update_branch}"