Skip to content

Commit 76482d2

Browse files
committed
Add support for Fedora 33
Signed-off-by: Dorian Stoll <[email protected]>
1 parent 11a8300 commit 76482d2

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
@@ -102,6 +102,45 @@ jobs:
102102
name: arch-latest
103103
path: release
104104

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

183222
release:
184223
name: Publish release
185-
needs: [build-deb, build-arch, build-f32, build-f31]
224+
needs: [build-deb, build-arch, build-f33, build-f32, build-f31]
186225
runs-on: ubuntu-latest
187226
steps:
188227
- name: Download Debian artifacts
@@ -195,6 +234,11 @@ jobs:
195234
with:
196235
name: arch-latest
197236

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

0 commit comments

Comments
 (0)