Skip to content

Commit 21ebab9

Browse files
committed
pkg: Add support for Fedora 39
1 parent 2048dbd commit 21ebab9

File tree

1 file changed

+105
-2
lines changed

1 file changed

+105
-2
lines changed

.github/workflows/ci.yml

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

126+
build-f39:
127+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128+
129+
name: Build Fedora 39 package
130+
runs-on: ubuntu-latest
131+
needs: [lint, test]
132+
container:
133+
image: registry.fedoraproject.org/fedora:39
134+
options: --security-opt seccomp=unconfined
135+
136+
steps:
137+
- name: Checkout code
138+
uses: actions/checkout@v3
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.LINUX_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@v3
167+
with:
168+
name: fedora-39-latest
169+
path: pkg/fedora/out/x86_64
170+
126171
build-f38:
127172
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128173

@@ -168,7 +213,6 @@ jobs:
168213
name: fedora-38-latest
169214
path: pkg/fedora/out/x86_64
170215

171-
172216
build-f37:
173217
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
174218

@@ -218,7 +262,7 @@ jobs:
218262
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
219263

220264
name: Publish release
221-
needs: [build-bin, build-deb, build-f38, build-f37]
265+
needs: [build-bin, build-deb, build-f39, build-f38, build-f37]
222266
runs-on: ubuntu-latest
223267

224268
steps:
@@ -234,6 +278,12 @@ jobs:
234278
name: debian-latest
235279
path: debian-latest
236280

281+
- name: Download Fedora 39 artifacts
282+
uses: actions/download-artifact@v3
283+
with:
284+
name: fedora-39-latest
285+
path: fedora-39-latest
286+
237287
- name: Download Fedora 38 artifacts
238288
uses: actions/download-artifact@v3
239289
with:
@@ -307,6 +357,59 @@ jobs:
307357
git commit -m "Update Debian DTX daemon"
308358
git push --set-upstream origin "${update_branch}"
309359
360+
repo-f39:
361+
name: Update Fedora 39 package repository
362+
needs: [release]
363+
runs-on: ubuntu-latest
364+
container:
365+
image: registry.fedoraproject.org/fedora:39
366+
options: --security-opt seccomp=unconfined
367+
steps:
368+
- name: Install dependencies
369+
run: |
370+
dnf install -y git findutils
371+
372+
- name: Download artifacts
373+
uses: actions/download-artifact@v3
374+
with:
375+
name: fedora-39-latest
376+
path: fedora-39-latest
377+
378+
- name: Update repository
379+
env:
380+
SURFACEBOT_TOKEN: ${{ secrets.LINUX_SURFACE_BOT_TOKEN }}
381+
BRANCH_STAGING: u/staging
382+
GIT_REF: ${{ github.ref }}
383+
run: |
384+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
385+
386+
# clone package repository
387+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
388+
389+
# copy packages
390+
cp fedora-39-latest/* repo/fedora/f39
391+
cd repo/fedora/f39
392+
393+
# parse git tag from ref
394+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
395+
396+
# convert packages into references
397+
for pkg in $(find . -name '*.rpm'); do
398+
echo "surface-dtx-daemon:$GIT_TAG/$(basename $pkg)" > $pkg.blob
399+
rm $pkg
400+
done
401+
402+
# set git identity
403+
git config --global user.email "[email protected]"
404+
git config --global user.name "surfacebot"
405+
406+
# commit and push
407+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
408+
git checkout -b "${update_branch}"
409+
git add .
410+
git commit -m "Update Fedora 39 DTX daemon"
411+
git push --set-upstream origin "${update_branch}"
412+
310413
repo-f38:
311414
name: Update Fedora 38 package repository
312415
needs: [release]

0 commit comments

Comments
 (0)