Skip to content

Commit 7451cb7

Browse files
committed
pkg: Add support for Fedora 38
1 parent 08b6362 commit 7451cb7

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-f38:
84+
name: Build Fedora 38 package
85+
runs-on: ubuntu-latest
86+
container:
87+
image: registry.fedoraproject.org/fedora:38
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.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-38-latest
139+
path: pkg/fedora/release
140+
83141
build-f37:
84142
name: Build Fedora 37 package
85143
runs-on: ubuntu-latest
@@ -198,7 +256,7 @@ jobs:
198256

199257
release:
200258
name: Publish release
201-
needs: [build-deb, build-f37, build-f36]
259+
needs: [build-deb, build-f38, build-f37, build-f36]
202260
runs-on: ubuntu-latest
203261
steps:
204262
- name: Download Debian artifacts
@@ -207,6 +265,12 @@ jobs:
207265
name: debian-latest
208266
path: debian-latest
209267

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

0 commit comments

Comments
 (0)