Skip to content

Commit 50f0e4f

Browse files
committed
Add support for Fedora 32
Signed-off-by: Dorian Stoll <[email protected]>
1 parent 2cb45a3 commit 50f0e4f

File tree

1 file changed

+95
-1
lines changed

1 file changed

+95
-1
lines changed

.github/workflows/package.yml

+95-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,45 @@ jobs:
103103
name: arch-latest
104104
path: release
105105

106+
build-f32:
107+
name: Build Fedora 32 package
108+
runs-on: ubuntu-latest
109+
container: fedora:32
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@v2
113+
114+
- name: Install build dependencies
115+
run: |
116+
dnf distro-sync -y
117+
dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
118+
dnf builddep -y fedora/surface-secureboot.spec
119+
120+
- name: Build package
121+
run: |
122+
cd fedora
123+
124+
# Build the .rpm packages
125+
./makerpm
126+
127+
- name: Sign packages
128+
env:
129+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
130+
run: |
131+
cd fedora/out/noarch
132+
133+
# import GPG key
134+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
135+
136+
# sign packages
137+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
138+
139+
- name: Upload artifacts
140+
uses: actions/upload-artifact@v1
141+
with:
142+
name: fedora-32-latest
143+
path: fedora/out/noarch
144+
106145
build-f31:
107146
name: Build Fedora 31 package
108147
runs-on: ubuntu-latest
@@ -183,7 +222,7 @@ jobs:
183222

184223
release:
185224
name: Publish release
186-
needs: [build-deb, build-arch, build-f31, build-f30]
225+
needs: [build-deb, build-arch, build-f32, build-f31, build-f30]
187226
runs-on: ubuntu-latest
188227
steps:
189228
- name: Download Debian artifacts
@@ -196,6 +235,11 @@ jobs:
196235
with:
197236
name: arch-latest
198237

238+
- name: Download Fedora 32 artifacts
239+
uses: actions/download-artifact@v1
240+
with:
241+
name: fedora-32-latest
242+
199243
- name: Download Fedora 31 artifacts
200244
uses: actions/download-artifact@v1
201245
with:
@@ -315,6 +359,56 @@ jobs:
315359
git commit -m "Update Arch Linux secure-boot MOK"
316360
git push --set-upstream origin "${update_branch}"
317361
362+
repo-f32:
363+
name: Update Fedora 32 package repository
364+
needs: [release]
365+
runs-on: ubuntu-latest
366+
container: fedora:32
367+
steps:
368+
- name: Install dependencies
369+
run: |
370+
dnf install -y git findutils
371+
372+
- name: Download artifacts
373+
uses: actions/download-artifact@v1
374+
with:
375+
name: fedora-32-latest
376+
377+
- name: Update repository
378+
env:
379+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
380+
BRANCH_STAGING: u/staging
381+
GIT_REF: ${{ github.ref }}
382+
run: |
383+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
384+
385+
# clone package repository
386+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
387+
388+
# copy packages
389+
cp fedora-32-latest/* repo/fedora/f32
390+
cd repo/fedora/f32
391+
392+
# parse git tag from ref
393+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
394+
395+
# convert packages into references
396+
for pkg in $(find . -name '*.rpm'); do
397+
echo "secureboot-mok:$GIT_TAG/$(basename $pkg)" > $pkg.blob
398+
rm $pkg
399+
done
400+
401+
# set git identity
402+
git config --global user.email "[email protected]"
403+
git config --global user.name "surfacebot"
404+
405+
# commit and push
406+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
407+
git checkout -b "${update_branch}"
408+
git add .
409+
git commit -m "Update Fedora 32 secure-boot MOK"
410+
git push --set-upstream origin "${update_branch}"
411+
318412
repo-f31:
319413
name: Update Fedora 31 package repository
320414
needs: [release]

0 commit comments

Comments
 (0)