-
Notifications
You must be signed in to change notification settings - Fork 5
498 lines (402 loc) · 13.7 KB
/
release.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
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
491
492
493
494
495
496
497
498
on:
push:
tags:
- v[0-9]+.*
- testing-ci.*
name: Build Packages
jobs:
build-deb:
name: Debian
runs-on: ubuntu-latest
container: ubuntu:20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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 dpkg-sig fakeroot wget git meson \
python3-pyudev python3-pytest python3-libevdev sudo gpg
apt-get -q -y build-dep libwacom libwacom-dev
# makedeb
wget -qO - 'https://proget.makedeb.org/debian-feeds/makedeb.pub' \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' \
| sudo tee /etc/apt/sources.list.d/makedeb.list
sudo apt update
apt-get -q -y update
apt-get -q -y install makedeb
- name: Build package
run: |
cd pkg/debian
./updlinks.sh
# Fix permissions (can't makepkg as root)
useradd -m build
echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chown -R build .
# Import GPG key for liwbacom/Peter Hutterer
su build --pty -s /bin/bash -c 'gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 3C2C43D9447D5938EF4551EBE23B7E70B467F0BF'
# build package
su build --pty -s /bin/bash -c 'makedeb --sync-deps --no-confirm --skip-pgp-check'
- name: Sign package
env:
GPG_KEY_ID: 56C464BAAC421453
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
run: |
cd pkg/debian
# import GPG key
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
export GPG_TTY=$(tty)
# sign package
dpkg-sig -g "--batch --no-tty" --sign builder -k $GPG_KEY_ID ./*.deb
- name: Prepare release
run: |
mkdir release
rm -f ./pkg/debian/libwacom-surface-dbgsym_*.deb || true
mv ./pkg/debian/*.deb release
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: debian-latest
path: 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@v3
- 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@v3
with:
name: fedora-41-latest
path: pkg/fedora/release
build-f40:
name: Build Fedora 40 package
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:40
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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@v3
with:
name: fedora-40-latest
path: pkg/fedora/release
build-f39:
name: Build Fedora 39 package
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:39
options: --security-opt seccomp=unconfined
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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@v3
with:
name: fedora-39-latest
path: pkg/fedora/release
release:
name: Publish release
needs: [build-deb, build-f41, build-f40, build-f39]
runs-on: ubuntu-latest
steps:
- name: Download Debian artifacts
uses: actions/download-artifact@v3
with:
name: debian-latest
path: debian-latest
- name: Download Fedora 40 artifacts
uses: actions/download-artifact@v3
with:
name: fedora-40-latest
path: fedora-40-latest
- name: Download Fedora 39 artifacts
uses: actions/download-artifact@v3
with:
name: fedora-39-latest
path: fedora-39-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@v3
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 "[email protected]"
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-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@v3
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 "[email protected]"
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}"
repo-f40:
name: Update Fedora 40 package repository
needs: [release]
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:40
options: --security-opt seccomp=unconfined
steps:
- name: Install dependencies
run: |
dnf install -y git findutils
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: fedora-40-latest
path: fedora-40-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-40-latest/* repo/fedora/f40
cd repo/fedora/f40
# 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 "[email protected]"
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 40 libwacom"
git push --set-upstream origin "${update_branch}"
repo-f39:
name: Update Fedora 39 package repository
needs: [release]
runs-on: ubuntu-latest
container:
image: registry.fedoraproject.org/fedora:39
options: --security-opt seccomp=unconfined
steps:
- name: Install dependencies
run: |
dnf install -y git findutils
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: fedora-39-latest
path: fedora-39-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-39-latest/* repo/fedora/f39
cd repo/fedora/f39
# 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 "[email protected]"
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 39 libwacom"
git push --set-upstream origin "${update_branch}"