Skip to content

Commit 5ff260d

Browse files
committed
pkg: Add support for Fedora 35
1 parent 2e31068 commit 5ff260d

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

.github/workflows/ci.yml

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,51 @@ jobs:
123123
name: debian-latest
124124
path: release
125125

126+
build-f35:
127+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128+
129+
name: Build Fedora 35 package
130+
runs-on: ubuntu-latest
131+
needs: [lint, test]
132+
container:
133+
image: fedora:35
134+
options: --security-opt seccomp=unconfined
135+
136+
steps:
137+
- name: Checkout code
138+
uses: actions/checkout@v2
139+
140+
- name: Install build dependencies
141+
run: |
142+
dnf distro-sync -y
143+
dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
144+
dnf builddep -y pkg/fedora/surface-dtx-daemon.spec
145+
146+
- name: Build package
147+
run: |
148+
cd pkg/fedora
149+
# Build the .rpm packages
150+
./makerpm
151+
152+
- name: Sign packages
153+
env:
154+
GPG_KEY_ID: 56C464BAAC421453
155+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
156+
run: |
157+
cd pkg/fedora/out/x86_64
158+
159+
# import GPG key
160+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
161+
162+
# sign package
163+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
164+
165+
- name: Upload artifacts
166+
uses: actions/upload-artifact@v1
167+
with:
168+
name: fedora-35-latest
169+
path: pkg/fedora/out/x86_64
170+
126171
build-f34:
127172
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128173

@@ -213,7 +258,7 @@ jobs:
213258
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
214259

215260
name: Publish release
216-
needs: [build-bin, build-deb, build-f34, build-f33]
261+
needs: [build-bin, build-deb, build-f35, build-f34, build-f33]
217262
runs-on: ubuntu-latest
218263

219264
steps:
@@ -227,6 +272,11 @@ jobs:
227272
with:
228273
name: debian-latest
229274

275+
- name: Download Fedora 35 artifacts
276+
uses: actions/download-artifact@v1
277+
with:
278+
name: fedora-35-latest
279+
230280
- name: Download Fedora 34 artifacts
231281
uses: actions/download-artifact@v1
232282
with:
@@ -297,6 +347,58 @@ jobs:
297347
git commit -m "Update Debian DTX daemon"
298348
git push --set-upstream origin "${update_branch}"
299349
350+
repo-f35:
351+
name: Update Fedora 35 package repository
352+
needs: [release]
353+
runs-on: ubuntu-latest
354+
container:
355+
image: fedora:35
356+
options: --security-opt seccomp=unconfined
357+
steps:
358+
- name: Install dependencies
359+
run: |
360+
dnf install -y git findutils
361+
362+
- name: Download artifacts
363+
uses: actions/download-artifact@v1
364+
with:
365+
name: fedora-35-latest
366+
367+
- name: Update repository
368+
env:
369+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
370+
BRANCH_STAGING: u/staging
371+
GIT_REF: ${{ github.ref }}
372+
run: |
373+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
374+
375+
# clone package repository
376+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
377+
378+
# copy packages
379+
cp fedora-35-latest/* repo/fedora/f35
380+
cd repo/fedora/f35
381+
382+
# parse git tag from ref
383+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
384+
385+
# convert packages into references
386+
for pkg in $(find . -name '*.rpm'); do
387+
echo "surface-dtx-daemon:$GIT_TAG/$(basename $pkg)" > $pkg.blob
388+
rm $pkg
389+
done
390+
391+
# set git identity
392+
git config --global user.email "[email protected]"
393+
git config --global user.name "surfacebot"
394+
395+
# commit and push
396+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
397+
git checkout -b "${update_branch}"
398+
git add .
399+
git commit -m "Update Fedora 35 DTX daemon"
400+
git push --set-upstream origin "${update_branch}"
401+
300402
repo-f34:
301403
name: Update Fedora 34 package repository
302404
needs: [release]

0 commit comments

Comments
 (0)