Skip to content

Commit 32af78b

Browse files
committed
pkg: Add support for Fedora 38
1 parent 4862286 commit 32af78b

File tree

1 file changed

+106
-1
lines changed

1 file changed

+106
-1
lines changed

.github/workflows/ci.yml

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

126+
build-f38:
127+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128+
129+
name: Build Fedora 38 package
130+
runs-on: ubuntu-latest
131+
needs: [lint, test]
132+
container:
133+
image: registry.fedoraproject.org/fedora:38
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.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-38-latest
169+
path: pkg/fedora/out/x86_64
170+
171+
126172
build-f37:
127173
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128174

@@ -217,7 +263,7 @@ jobs:
217263
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
218264

219265
name: Publish release
220-
needs: [build-bin, build-deb, build-f37, build-f36]
266+
needs: [build-bin, build-deb, build-f38, build-f37, build-f36]
221267
runs-on: ubuntu-latest
222268

223269
steps:
@@ -233,6 +279,12 @@ jobs:
233279
name: debian-latest
234280
path: debian-latest
235281

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

0 commit comments

Comments
 (0)