Skip to content

Commit 1eeb240

Browse files
committed
Add support for Fedora 40
1 parent f083fac commit 1eeb240

File tree

1 file changed

+118
-1
lines changed

1 file changed

+118
-1
lines changed

.github/workflows/release.yml

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,64 @@ jobs:
8080
name: debian-latest
8181
path: release
8282

83+
build-f40:
84+
name: Build Fedora 40 package
85+
runs-on: ubuntu-latest
86+
container:
87+
image: registry.fedoraproject.org/fedora:40
88+
options: --security-opt seccomp=unconfined
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v3
92+
93+
- name: Install build dependencies
94+
run: |
95+
dnf distro-sync -y
96+
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
97+
dnf builddep -y pkg/fedora/libwacom-surface.spec
98+
99+
- name: Build package
100+
run: |
101+
cd pkg/fedora
102+
103+
# Build the .rpm packages
104+
./makerpm
105+
106+
- name: Sign packages
107+
env:
108+
GPG_KEY_ID: 56C464BAAC421453
109+
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
110+
run: |
111+
cd pkg/fedora/out
112+
113+
# import GPG key
114+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
115+
116+
# sign package
117+
cd noarch
118+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
119+
120+
cd ..
121+
122+
cd x86_64
123+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
124+
125+
- name: Prepare artifacts
126+
run: |
127+
cd pkg/fedora
128+
mkdir release
129+
130+
cp out/noarch/* release/
131+
cp out/x86_64/* release/
132+
133+
rm release/libwacom-surface-devel-*
134+
135+
- name: Upload artifacts
136+
uses: actions/upload-artifact@v3
137+
with:
138+
name: fedora-40-latest
139+
path: pkg/fedora/release
140+
83141
build-f39:
84142
name: Build Fedora 39 package
85143
runs-on: ubuntu-latest
@@ -199,7 +257,7 @@ jobs:
199257

200258
release:
201259
name: Publish release
202-
needs: [build-deb, build-f39, build-f38]
260+
needs: [build-deb, build-f40, build-f39, build-f38]
203261
runs-on: ubuntu-latest
204262
steps:
205263
- name: Download Debian artifacts
@@ -208,6 +266,12 @@ jobs:
208266
name: debian-latest
209267
path: debian-latest
210268

269+
- name: Download Fedora 40 artifacts
270+
uses: actions/download-artifact@v3
271+
with:
272+
name: fedora-40-latest
273+
path: fedora-40-latest
274+
211275
- name: Download Fedora 39 artifacts
212276
uses: actions/download-artifact@v3
213277
with:
@@ -281,6 +345,59 @@ jobs:
281345
git commit -m "Update Debian libwacom"
282346
git push --set-upstream origin "${update_branch}"
283347
348+
repo-f40:
349+
name: Update Fedora 40 package repository
350+
needs: [release]
351+
runs-on: ubuntu-latest
352+
container:
353+
image: registry.fedoraproject.org/fedora:40
354+
options: --security-opt seccomp=unconfined
355+
steps:
356+
- name: Install dependencies
357+
run: |
358+
dnf install -y git findutils
359+
360+
- name: Download artifacts
361+
uses: actions/download-artifact@v3
362+
with:
363+
name: fedora-40-latest
364+
path: fedora-40-latest
365+
366+
- name: Update repository
367+
env:
368+
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
369+
BRANCH_STAGING: u/staging
370+
GIT_REF: ${{ github.ref }}
371+
run: |
372+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
373+
374+
# clone package repository
375+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
376+
377+
# copy packages
378+
cp fedora-40-latest/* repo/fedora/f40
379+
cd repo/fedora/f40
380+
381+
# parse git tag from ref
382+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
383+
384+
# convert packages into references
385+
for pkg in $(find . -name '*.rpm'); do
386+
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
387+
rm $pkg
388+
done
389+
390+
# set git identity
391+
git config --global user.email "[email protected]"
392+
git config --global user.name "surfacebot"
393+
394+
# commit and push
395+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
396+
git checkout -b "${update_branch}"
397+
git add .
398+
git commit -m "Update Fedora 40 libwacom"
399+
git push --set-upstream origin "${update_branch}"
400+
284401
repo-f39:
285402
name: Update Fedora 39 package repository
286403
needs: [release]

0 commit comments

Comments
 (0)