Skip to content

Commit 106d575

Browse files
committed
pkg: Add support for Fedora 35
1 parent 1ad0b2d commit 106d575

File tree

1 file changed

+99
-1
lines changed

1 file changed

+99
-1
lines changed

.github/workflows/package.yml

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,47 @@ jobs:
102102
name: arch-latest
103103
path: release
104104

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

183224
release:
184225
name: Publish release
185-
needs: [build-deb, build-arch, build-f34, build-f33]
226+
needs: [build-deb, build-arch, build-f35, build-f34, build-f33]
186227
runs-on: ubuntu-latest
187228
steps:
188229
- name: Download Debian artifacts
@@ -195,6 +236,11 @@ jobs:
195236
with:
196237
name: arch-latest
197238

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

0 commit comments

Comments
 (0)