@@ -134,6 +134,51 @@ jobs:
134134 name : debian-latest
135135 path : release
136136
137+ build-f38 :
138+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
139+
140+ name : Build Fedora 38 package
141+ runs-on : ubuntu-latest
142+ needs : [lint, test]
143+ container :
144+ image : registry.fedoraproject.org/fedora:38
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.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-38-latest
180+ path : pkg/fedora/out/x86_64
181+
137182 build-f37 :
138183 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
139184
@@ -228,7 +273,7 @@ jobs:
228273 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
229274
230275 name : Publish release
231- needs : [build-bin, build-deb, build-f37, build-f36]
276+ needs : [build-bin, build-deb, build-f38, build- f37, build-f36]
232277 runs-on : ubuntu-latest
233278
234279 steps :
@@ -244,6 +289,12 @@ jobs:
244289 name : debian-latest
245290 path : debian-latest
246291
292+ - name : Download Fedora 38 artifacts
293+ uses : actions/download-artifact@v3
294+ with :
295+ name : fedora-38-latest
296+ path : fedora-38-latest
297+
247298 - name : Download Fedora 37 artifacts
248299 uses : actions/download-artifact@v3
249300 with :
@@ -317,6 +368,59 @@ jobs:
317368 git commit -m "Update Debian surface-control"
318369 git push --set-upstream origin "${update_branch}"
319370
371+ repo-f38 :
372+ name : Update Fedora 38 package repository
373+ needs : [release]
374+ runs-on : ubuntu-latest
375+ container :
376+ image : registry.fedoraproject.org/fedora:38
377+ options : --security-opt seccomp=unconfined
378+ steps :
379+ - name : Install dependencies
380+ run : |
381+ dnf install -y git findutils
382+
383+ - name : Download artifacts
384+ uses : actions/download-artifact@v3
385+ with :
386+ name : fedora-38-latest
387+ path : fedora-38-latest
388+
389+ - name : Update repository
390+ env :
391+ SURFACEBOT_TOKEN : ${{ secrets.GITHUB_BOT_TOKEN }}
392+ BRANCH_STAGING : u/staging
393+ GIT_REF : ${{ github.ref }}
394+ run : |
395+ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
396+
397+ # clone package repository
398+ git clone -b "${BRANCH_STAGING}" "${repo}" repo
399+
400+ # copy packages
401+ cp fedora-38-latest/* repo/fedora/f38
402+ cd repo/fedora/f38
403+
404+ # parse git tag from ref
405+ GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
406+
407+ # convert packages into references
408+ for pkg in $(find . -name '*.rpm'); do
409+ echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
410+ rm $pkg
411+ done
412+
413+ # set git identity
414+ git config --global user.email "[email protected] " 415+ git config --global user.name "surfacebot"
416+
417+ # commit and push
418+ update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
419+ git checkout -b "${update_branch}"
420+ git add .
421+ git commit -m "Update Fedora 38 surface-control"
422+ git push --set-upstream origin "${update_branch}"
423+
320424 repo-f37 :
321425 name : Update Fedora 37 package repository
322426 needs : [release]
0 commit comments