@@ -213,11 +213,56 @@ jobs:
213213 name : fedora-41-latest
214214 path : pkg/fedora/out/x86_64
215215
216+ build-f42 :
217+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
218+
219+ name : Build Fedora 42 package
220+ runs-on : ubuntu-latest
221+ needs : [lint, test]
222+ container :
223+ image : registry.fedoraproject.org/fedora:42
224+ options : --security-opt seccomp=unconfined
225+
226+ steps :
227+ - name : Checkout code
228+ uses : actions/checkout@v4
229+
230+ - name : Install build dependencies
231+ run : |
232+ dnf distro-sync -y
233+ dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
234+ dnf builddep -y pkg/fedora/surface-dtx-daemon.spec
235+
236+ - name : Build package
237+ run : |
238+ cd pkg/fedora
239+ # Build the .rpm packages
240+ ./makerpm
241+
242+ - name : Sign packages
243+ env :
244+ GPG_KEY_ID : 56C464BAAC421453
245+ GPG_KEY : ${{ secrets.LINUX_SURFACE_GPG_KEY }}
246+ run : |
247+ cd pkg/fedora/out/x86_64
248+
249+ # import GPG key
250+ echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
251+
252+ # sign package
253+ rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
254+
255+ - name : Upload artifacts
256+ uses : actions/upload-artifact@v4
257+ with :
258+ name : fedora-42-latest
259+ path : pkg/fedora/out/x86_64
260+
216261 release :
217262 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
218263
219264 name : Publish release
220- needs : [build-bin, build-deb, build-f40, build-f41]
265+ needs : [build-bin, build-deb, build-f40, build-f41, build-f42 ]
221266 runs-on : ubuntu-latest
222267
223268 steps :
@@ -245,6 +290,12 @@ jobs:
245290 name : fedora-41-latest
246291 path : fedora-41-latest
247292
293+ - name : Download Fedora 42 artifacts
294+ uses : actions/download-artifact@v4
295+ with :
296+ name : fedora-42-latest
297+ path : fedora-42-latest
298+
248299 - name : Upload assets
249300 uses : svenstaro/upload-release-action@v2
250301 with :
@@ -411,3 +462,56 @@ jobs:
411462 git add .
412463 git commit -m "Update Fedora 41 DTX daemon"
413464 git push --set-upstream origin "${update_branch}"
465+
466+ repo-f42 :
467+ name : Update Fedora 42 package repository
468+ needs : [release]
469+ runs-on : ubuntu-latest
470+ container :
471+ image : registry.fedoraproject.org/fedora:42
472+ options : --security-opt seccomp=unconfined
473+ steps :
474+ - name : Install dependencies
475+ run : |
476+ dnf install -y git findutils
477+
478+ - name : Download artifacts
479+ uses : actions/download-artifact@v4
480+ with :
481+ name : fedora-42-latest
482+ path : fedora-42-latest
483+
484+ - name : Update repository
485+ env :
486+ SURFACEBOT_TOKEN : ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
487+ BRANCH_STAGING : u/staging
488+ GIT_REF : ${{ github.ref }}
489+ run : |
490+ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
491+
492+ # clone package repository
493+ git clone -b "${BRANCH_STAGING}" "${repo}" repo
494+
495+ # copy packages
496+ cp fedora-42-latest/* repo/fedora/f42
497+ cd repo/fedora/f42
498+
499+ # parse git tag from ref
500+ GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
501+
502+ # convert packages into references
503+ for pkg in $(find . -name '*.rpm'); do
504+ echo "surface-dtx-daemon:$GIT_TAG/$(basename $pkg)" > $pkg.blob
505+ rm $pkg
506+ done
507+
508+ # set git identity
509+ git config --global user.email "[email protected] " 510+ git config --global user.name "surfacebot"
511+
512+ # commit and push
513+ update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
514+ git checkout -b "${update_branch}"
515+ git add .
516+ git commit -m "Update Fedora 42 DTX daemon"
517+ git push --set-upstream origin "${update_branch}"
0 commit comments