Skip to content

Commit ac95729

Browse files
committed
Add support for Fedora 34
Signed-off-by: Dorian Stoll <[email protected]>
1 parent 4b3952a commit ac95729

File tree

1 file changed

+112
-2
lines changed

1 file changed

+112
-2
lines changed

.github/workflows/release.yml

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,62 @@ jobs:
5353
name: debian-latest
5454
path: release
5555

56+
build-f34:
57+
name: Build Fedora 34 package
58+
runs-on: ubuntu-latest
59+
container: fedora:34
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v2
63+
64+
- name: Install build dependencies
65+
run: |
66+
dnf distro-sync -y
67+
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
68+
dnf builddep -y pkg/fedora/libwacom-surface.spec
69+
70+
- name: Build package
71+
run: |
72+
cd pkg/fedora
73+
74+
# Build the .rpm packages
75+
./makerpm
76+
77+
- name: Sign packages
78+
env:
79+
GPG_KEY_ID: 56C464BAAC421453
80+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
81+
run: |
82+
cd pkg/fedora/out
83+
84+
# import GPG key
85+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
86+
87+
# sign package
88+
cd noarch
89+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
90+
91+
cd ..
92+
93+
cd x86_64
94+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
95+
96+
- name: Prepare artifacts
97+
run: |
98+
cd pkg/fedora
99+
mkdir release
100+
101+
cp out/noarch/* release/
102+
cp out/x86_64/* release/
103+
104+
rm release/libwacom-surface-devel-*
105+
106+
- name: Upload artifacts
107+
uses: actions/upload-artifact@v1
108+
with:
109+
name: fedora-34-latest
110+
path: pkg/fedora/release
111+
56112
build-f33:
57113
name: Build Fedora 33 package
58114
runs-on: ubuntu-latest
@@ -167,14 +223,19 @@ jobs:
167223

168224
release:
169225
name: Publish release
170-
needs: [build-deb, build-f33, build-f32]
226+
needs: [build-deb, build-f34, build-f33, build-f32]
171227
runs-on: ubuntu-latest
172228
steps:
173229
- name: Download Debian artifacts
174230
uses: actions/download-artifact@v1
175231
with:
176232
name: debian-latest
177233

234+
- name: Download Fedora 34 artifacts
235+
uses: actions/download-artifact@v1
236+
with:
237+
name: fedora-34-latest
238+
178239
- name: Download Fedora 33 artifacts
179240
uses: actions/download-artifact@v1
180241
with:
@@ -245,6 +306,56 @@ jobs:
245306
git commit -m "Update Debian libwacom"
246307
git push --set-upstream origin "${update_branch}"
247308
309+
repo-f34:
310+
name: Update Fedora 34 package repository
311+
needs: [release]
312+
runs-on: ubuntu-latest
313+
container: fedora:34
314+
steps:
315+
- name: Install dependencies
316+
run: |
317+
dnf install -y git findutils
318+
319+
- name: Download artifacts
320+
uses: actions/download-artifact@v1
321+
with:
322+
name: fedora-34-latest
323+
324+
- name: Update repository
325+
env:
326+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
327+
BRANCH_STAGING: u/staging
328+
GIT_REF: ${{ github.ref }}
329+
run: |
330+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
331+
332+
# clone package repository
333+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
334+
335+
# copy packages
336+
cp fedora-34-latest/* repo/fedora/f34
337+
cd repo/fedora/f34
338+
339+
# parse git tag from ref
340+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
341+
342+
# convert packages into references
343+
for pkg in $(find . -name '*.rpm'); do
344+
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
345+
rm $pkg
346+
done
347+
348+
# set git identity
349+
git config --global user.email "[email protected]"
350+
git config --global user.name "surfacebot"
351+
352+
# commit and push
353+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
354+
git checkout -b "${update_branch}"
355+
git add .
356+
git commit -m "Update Fedora 34 libwacom"
357+
git push --set-upstream origin "${update_branch}"
358+
248359
repo-f33:
249360
name: Update Fedora 33 package repository
250361
needs: [release]
@@ -344,4 +455,3 @@ jobs:
344455
git add .
345456
git commit -m "Update Fedora 32 libwacom"
346457
git push --set-upstream origin "${update_branch}"
347-

0 commit comments

Comments
 (0)