@@ -134,6 +134,52 @@ jobs:
134134 name : debian-latest
135135 path : release
136136
137+ build-f39 :
138+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
139+
140+ name : Build Fedora 39 package
141+ runs-on : ubuntu-latest
142+ needs : [lint, test]
143+ container :
144+ image : registry.fedoraproject.org/fedora:39
145+ options : --security-opt seccomp=unconfined
146+
147+ steps :
148+ - name : Checkout code
149+ uses : actions/checkout@v3
150+
151+ - name : Install build dependencies
152+ run : |
153+ dnf distro-sync -y
154+ dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
155+ dnf builddep -y pkg/fedora/surface-control.spec
156+
157+ - name : Build package
158+ run : |
159+ cd pkg/fedora
160+ # Build the .rpm packages
161+ ./makerpm
162+
163+ - name : Sign packages
164+ env :
165+ GPG_KEY_ID : 56C464BAAC421453
166+ GPG_KEY : ${{ secrets.LINUX_SURFACE_GPG_KEY }}
167+ run : |
168+ cd pkg/fedora/out/x86_64
169+
170+ # import GPG key
171+ echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
172+
173+ # sign package
174+ rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
175+
176+ - name : Upload artifacts
177+ uses : actions/upload-artifact@v3
178+ with :
179+ name : fedora-39-latest
180+ path : pkg/fedora/out/x86_64
181+
182+
137183 build-f38 :
138184 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
139185
@@ -228,7 +274,7 @@ jobs:
228274 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
229275
230276 name : Publish release
231- needs : [build-bin, build-deb, build-f38, build-f37]
277+ needs : [build-bin, build-deb, build-f39, build- f38, build-f37]
232278 runs-on : ubuntu-latest
233279
234280 steps :
@@ -244,6 +290,12 @@ jobs:
244290 name : debian-latest
245291 path : debian-latest
246292
293+ - name : Download Fedora 39 artifacts
294+ uses : actions/download-artifact@v3
295+ with :
296+ name : fedora-39-latest
297+ path : fedora-39-latest
298+
247299 - name : Download Fedora 38 artifacts
248300 uses : actions/download-artifact@v3
249301 with :
@@ -317,6 +369,60 @@ jobs:
317369 git commit -m "Update Debian surface-control"
318370 git push --set-upstream origin "${update_branch}"
319371
372+ repo-f39 :
373+ name : Update Fedora 39 package repository
374+ needs : [release]
375+ runs-on : ubuntu-latest
376+ container :
377+ image : registry.fedoraproject.org/fedora:39
378+ options : --security-opt seccomp=unconfined
379+ steps :
380+ - name : Install dependencies
381+ run : |
382+ dnf install -y git findutils
383+
384+ - name : Download artifacts
385+ uses : actions/download-artifact@v3
386+ with :
387+ name : fedora-39-latest
388+ path : fedora-39-latest
389+
390+ - name : Update repository
391+ env :
392+ SURFACEBOT_TOKEN : ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
393+ BRANCH_STAGING : u/staging
394+ GIT_REF : ${{ github.ref }}
395+ run : |
396+ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
397+
398+ # clone package repository
399+ git clone -b "${BRANCH_STAGING}" "${repo}" repo
400+
401+ # copy packages
402+ cp fedora-39-latest/* repo/fedora/f39
403+ cd repo/fedora/f39
404+
405+ # parse git tag from ref
406+ GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
407+
408+ # convert packages into references
409+ for pkg in $(find . -name '*.rpm'); do
410+ echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
411+ rm $pkg
412+ done
413+
414+ # set git identity
415+ git config --global user.email "[email protected] " 416+ git config --global user.name "surfacebot"
417+
418+ # commit and push
419+ update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
420+ git checkout -b "${update_branch}"
421+ git add .
422+ git commit -m "Update Fedora 39 surface-control"
423+ git push --set-upstream origin "${update_branch}"
424+
425+
320426 repo-f38 :
321427 name : Update Fedora 38 package repository
322428 needs : [release]
0 commit comments