Skip to content

Commit 94e0da2

Browse files
committed
Add support for Fedora 32
Signed-off-by: Dorian Stoll <[email protected]>
1 parent a4b4b8b commit 94e0da2

File tree

1 file changed

+99
-1
lines changed

1 file changed

+99
-1
lines changed

.github/workflows/ci.yml

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,49 @@ jobs:
116116
name: debian-latest
117117
path: release
118118

119+
build-f32:
120+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
121+
122+
name: Build Fedora 32 package
123+
runs-on: ubuntu-latest
124+
needs: [lint, test]
125+
container: fedora:32
126+
127+
steps:
128+
- name: Checkout code
129+
uses: actions/checkout@v2
130+
131+
- name: Install build dependencies
132+
run: |
133+
dnf distro-sync -y
134+
dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
135+
dnf builddep -y pkg/fedora/surface-control.spec
136+
137+
- name: Build package
138+
run: |
139+
cd pkg/fedora
140+
# Build the .rpm packages
141+
./makerpm
142+
143+
- name: Sign packages
144+
env:
145+
GPG_KEY_ID: 56C464BAAC421453
146+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
147+
run: |
148+
cd pkg/fedora/out/x86_64
149+
150+
# import GPG key
151+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
152+
153+
# sign package
154+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
155+
156+
- name: Upload artifacts
157+
uses: actions/upload-artifact@v1
158+
with:
159+
name: fedora-32-latest
160+
path: pkg/fedora/out/x86_64
161+
119162
build-f31:
120163
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
121164

@@ -206,7 +249,7 @@ jobs:
206249
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
207250

208251
name: Publish release
209-
needs: [build-bin, build-deb, build-f31, build-f30]
252+
needs: [build-bin, build-deb, build-f32, build-f31, build-f30]
210253
runs-on: ubuntu-latest
211254

212255
steps:
@@ -220,6 +263,11 @@ jobs:
220263
with:
221264
name: debian-latest
222265

266+
- name: Download Fedora 32 artifacts
267+
uses: actions/download-artifact@v1
268+
with:
269+
name: fedora-32-latest
270+
223271
- name: Download Fedora 31 artifacts
224272
uses: actions/download-artifact@v1
225273
with:
@@ -290,6 +338,56 @@ jobs:
290338
git commit -m "Update Debian secure-boot MOK"
291339
git push --set-upstream origin "${update_branch}"
292340
341+
repo-f32:
342+
name: Update Fedora 32 package repository
343+
needs: [release]
344+
runs-on: ubuntu-latest
345+
container: fedora:32
346+
steps:
347+
- name: Install dependencies
348+
run: |
349+
dnf install -y git findutils
350+
351+
- name: Download artifacts
352+
uses: actions/download-artifact@v1
353+
with:
354+
name: fedora-32-latest
355+
356+
- name: Update repository
357+
env:
358+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
359+
BRANCH_STAGING: u/staging
360+
GIT_REF: ${{ github.ref }}
361+
run: |
362+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
363+
364+
# clone package repository
365+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
366+
367+
# copy packages
368+
cp fedora-32-latest/* repo/fedora/f32
369+
cd repo/fedora/f32
370+
371+
# parse git tag from ref
372+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
373+
374+
# convert packages into references
375+
for pkg in $(find . -name '*.rpm'); do
376+
echo "surface-control:$GIT_TAG/$(basename $pkg)" > $pkg.blob
377+
rm $pkg
378+
done
379+
380+
# set git identity
381+
git config --global user.email "[email protected]"
382+
git config --global user.name "surfacebot"
383+
384+
# commit and push
385+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
386+
git checkout -b "${update_branch}"
387+
git add .
388+
git commit -m "Update Fedora 32 secure-boot MOK"
389+
git push --set-upstream origin "${update_branch}"
390+
293391
repo-f31:
294392
name: Update Fedora 31 package repository
295393
needs: [release]

0 commit comments

Comments
 (0)