Skip to content

Commit 654e710

Browse files
committed
pkg: Add support for Fedora 38
1 parent dc9c162 commit 654e710

File tree

1 file changed

+97
-1
lines changed

1 file changed

+97
-1
lines changed

.github/workflows/package.yml

+97-1
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,48 @@ jobs:
182182
name: fedora-37-latest
183183
path: fedora/out/noarch
184184

185+
build-f38:
186+
name: Build Fedora 38 package
187+
runs-on: ubuntu-latest
188+
container: registry.fedoraproject.org/fedora:38
189+
steps:
190+
- name: Checkout code
191+
uses: actions/checkout@v3
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.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@v3
220+
with:
221+
name: fedora-38-latest
222+
path: fedora/out/noarch
223+
185224
release:
186225
name: Publish release
187-
needs: [build-deb, build-arch, build-f36, build-f37]
226+
needs: [build-deb, build-arch, build-f36, build-f37, build-f38]
188227
runs-on: ubuntu-latest
189228
steps:
190229
- name: Download Debian artifacts
@@ -211,6 +250,12 @@ jobs:
211250
name: fedora-37-latest
212251
path: fedora-37-latest
213252

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

0 commit comments

Comments
 (0)