@@ -134,6 +134,51 @@ jobs:
134134 name : debian-latest
135135 path : release
136136
137+ build-f37 :
138+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
139+
140+ name : Build Fedora 37 package
141+ runs-on : ubuntu-latest
142+ needs : [lint, test]
143+ container :
144+ image : registry.fedoraproject.org/fedora:37
145+ options : --security-opt seccomp=unconfined
146+
147+ steps :
148+ - name : Checkout code
149+ uses : actions/checkout@v2
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@v1
178+ with :
179+ name : fedora-37-latest
180+ path : pkg/fedora/out/x86_64
181+
137182 build-f36 :
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-f36, build-f35]
276+ needs : [build-bin, build-deb, build-f37, build- f36, build-f35]
232277 runs-on : ubuntu-latest
233278
234279 steps :
@@ -242,6 +287,11 @@ jobs:
242287 with :
243288 name : debian-latest
244289
290+ - name : Download Fedora 37 artifacts
291+ uses : actions/download-artifact@v1
292+ with :
293+ name : fedora-37-latest
294+
245295 - name : Download Fedora 36 artifacts
246296 uses : actions/download-artifact@v1
247297 with :
@@ -312,6 +362,58 @@ jobs:
312362 git commit -m "Update Debian surface-control"
313363 git push --set-upstream origin "${update_branch}"
314364
365+ repo-f37 :
366+ name : Update Fedora 37 package repository
367+ needs : [release]
368+ runs-on : ubuntu-latest
369+ container :
370+ image : registry.fedoraproject.org/fedora:37
371+ options : --security-opt seccomp=unconfined
372+ steps :
373+ - name : Install dependencies
374+ run : |
375+ dnf install -y git findutils
376+
377+ - name : Download artifacts
378+ uses : actions/download-artifact@v1
379+ with :
380+ name : fedora-37-latest
381+
382+ - name : Update repository
383+ env :
384+ SURFACEBOT_TOKEN : ${{ secrets.GITHUB_BOT_TOKEN }}
385+ BRANCH_STAGING : u/staging
386+ GIT_REF : ${{ github.ref }}
387+ run : |
388+ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
389+
390+ # clone package repository
391+ git clone -b "${BRANCH_STAGING}" "${repo}" repo
392+
393+ # copy packages
394+ cp fedora-37-latest/* repo/fedora/f37
395+ cd repo/fedora/f37
396+
397+ # parse git tag from ref
398+ GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
399+
400+ # convert packages into references
401+ for pkg in $(find . -name '*.rpm'); do
402+ echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
403+ rm $pkg
404+ done
405+
406+ # set git identity
407+ git config --global user.email "[email protected] " 408+ git config --global user.name "surfacebot"
409+
410+ # commit and push
411+ update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
412+ git checkout -b "${update_branch}"
413+ git add .
414+ git commit -m "Update Fedora 37 surface-control"
415+ git push --set-upstream origin "${update_branch}"
416+
315417 repo-f36 :
316418 name : Update Fedora 36 package repository
317419 needs : [release]
0 commit comments