Skip to content

Commit d9b7515

Browse files
committed
.github/workflows: Add support for Fedora 43
1 parent 10f9843 commit d9b7515

File tree

1 file changed

+98
-1
lines changed

1 file changed

+98
-1
lines changed

.github/workflows/package.yml

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,49 @@ jobs:
182182
name: fedora-42-latest
183183
path: fedora/out/noarch
184184

185+
build-f43:
186+
name: Build Fedora 43 package
187+
runs-on: ubuntu-latest
188+
container: registry.fedoraproject.org/fedora:43
189+
steps:
190+
- name: Checkout code
191+
uses: actions/checkout@v4
192+
193+
- name: Install build dependencies
194+
run: |
195+
dnf distro-sync -y
196+
dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
197+
dnf builddep -y fedora/surface-secureboot.spec
198+
199+
- name: Build package
200+
run: |
201+
cd fedora
202+
203+
# Build the .rpm packages
204+
./makerpm
205+
206+
- name: Sign packages
207+
env:
208+
GPG_KEY: ${{ secrets.LINUX_SURFACE_GPG_KEY }}
209+
run: |
210+
cd fedora/out/noarch
211+
212+
# import GPG key
213+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
214+
215+
# sign packages
216+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
217+
218+
- name: Upload artifacts
219+
uses: actions/upload-artifact@v4
220+
with:
221+
name: fedora-43-latest
222+
path: fedora/out/noarch
223+
224+
185225
release:
186226
name: Publish release
187-
needs: [build-deb, build-arch, build-f41, build-f42]
227+
needs: [build-deb, build-arch, build-f41, build-f42, build-f43]
188228
runs-on: ubuntu-latest
189229
steps:
190230
- name: Download Debian artifacts
@@ -211,6 +251,12 @@ jobs:
211251
name: fedora-42-latest
212252
path: fedora-42-latest
213253

254+
- name: Download Fedora 43 artifacts
255+
uses: actions/download-artifact@v4
256+
with:
257+
name: fedora-43-latest
258+
path: fedora-43-latest
259+
214260
- name: Upload assets
215261
uses: svenstaro/upload-release-action@v2
216262
with:
@@ -423,3 +469,54 @@ jobs:
423469
git add .
424470
git commit -m "Update Fedora 42 secure-boot MOK"
425471
git push --set-upstream origin "${update_branch}"
472+
473+
repo-f43:
474+
name: Update Fedora 43 package repository
475+
needs: [release]
476+
runs-on: ubuntu-latest
477+
container: registry.fedoraproject.org/fedora:43
478+
steps:
479+
- name: Install dependencies
480+
run: |
481+
dnf install -y git findutils
482+
483+
- name: Download artifacts
484+
uses: actions/download-artifact@v4
485+
with:
486+
name: fedora-43-latest
487+
path: fedora-43-latest
488+
489+
- name: Update repository
490+
env:
491+
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
492+
BRANCH_STAGING: u/staging
493+
GIT_REF: ${{ github.ref }}
494+
run: |
495+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
496+
497+
# clone package repository
498+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
499+
500+
# copy packages
501+
cp fedora-43-latest/* repo/fedora/f43
502+
cd repo/fedora/f43
503+
504+
# parse git tag from ref
505+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
506+
507+
# convert packages into references
508+
for pkg in $(find . -name '*.rpm'); do
509+
echo "secureboot-mok:$GIT_TAG/$(basename $pkg)" > $pkg.blob
510+
rm $pkg
511+
done
512+
513+
# set git identity
514+
git config --global user.email "[email protected]"
515+
git config --global user.name "surfacebot"
516+
517+
# commit and push
518+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
519+
git checkout -b "${update_branch}"
520+
git add .
521+
git commit -m "Update Fedora 43 secure-boot MOK"
522+
git push --set-upstream origin "${update_branch}"

0 commit comments

Comments
 (0)