Skip to content

Commit f6e4d84

Browse files
committed
pkg: Add support for Fedora 37
1 parent 8df154e commit f6e4d84

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

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

219264
name: Publish release
220-
needs: [build-bin, build-deb, build-f36, build-f35]
265+
needs: [build-bin, build-deb, build-f37, build-f36, build-f35]
221266
runs-on: ubuntu-latest
222267

223268
steps:
@@ -231,6 +276,11 @@ jobs:
231276
with:
232277
name: debian-latest
233278

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

0 commit comments

Comments
 (0)