@@ -123,6 +123,49 @@ jobs:
123123 name : debian-latest
124124 path : release
125125
126+ build-f33 :
127+ if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128+
129+ name : Build Fedora 33 package
130+ runs-on : ubuntu-latest
131+ needs : [lint, test]
132+ container : fedora:33
133+
134+ steps :
135+ - name : Checkout code
136+ uses : actions/checkout@v2
137+
138+ - name : Install build dependencies
139+ run : |
140+ dnf distro-sync -y
141+ dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)'
142+ dnf builddep -y pkg/fedora/surface-dtx-daemon.spec
143+
144+ - name : Build package
145+ run : |
146+ cd pkg/fedora
147+ # Build the .rpm packages
148+ ./makerpm
149+
150+ - name : Sign packages
151+ env :
152+ GPG_KEY_ID : 56C464BAAC421453
153+ GPG_KEY : ${{ secrets.SURFACE_GPG_KEY }}
154+ run : |
155+ cd pkg/fedora/out/x86_64
156+
157+ # import GPG key
158+ echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
159+
160+ # sign package
161+ rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
162+
163+ - name : Upload artifacts
164+ uses : actions/upload-artifact@v1
165+ with :
166+ name : fedora-33-latest
167+ path : pkg/fedora/out/x86_64
168+
126169 build-f32 :
127170 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
128171
@@ -213,7 +256,7 @@ jobs:
213256 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
214257
215258 name : Publish release
216- needs : [build-bin, build-deb, build-f32, build-f31]
259+ needs : [build-bin, build-deb, build-f33, build- f32, build-f31]
217260 runs-on : ubuntu-latest
218261
219262 steps :
@@ -227,6 +270,11 @@ jobs:
227270 with :
228271 name : debian-latest
229272
273+ - name : Download Fedora 33 artifacts
274+ uses : actions/download-artifact@v1
275+ with :
276+ name : fedora-33-latest
277+
230278 - name : Download Fedora 32 artifacts
231279 uses : actions/download-artifact@v1
232280 with :
@@ -297,6 +345,56 @@ jobs:
297345 git commit -m "Update Debian DTX daemon"
298346 git push --set-upstream origin "${update_branch}"
299347
348+ repo-f33 :
349+ name : Update Fedora 33 package repository
350+ needs : [release]
351+ runs-on : ubuntu-latest
352+ container : fedora:33
353+ steps :
354+ - name : Install dependencies
355+ run : |
356+ dnf install -y git findutils
357+
358+ - name : Download artifacts
359+ uses : actions/download-artifact@v1
360+ with :
361+ name : fedora-33-latest
362+
363+ - name : Update repository
364+ env :
365+ SURFACEBOT_TOKEN : ${{ secrets.GITHUB_BOT_TOKEN }}
366+ BRANCH_STAGING : u/staging
367+ GIT_REF : ${{ github.ref }}
368+ run : |
369+ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
370+
371+ # clone package repository
372+ git clone -b "${BRANCH_STAGING}" "${repo}" repo
373+
374+ # copy packages
375+ cp fedora-33-latest/* repo/fedora/f33
376+ cd repo/fedora/f33
377+
378+ # parse git tag from ref
379+ GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
380+
381+ # convert packages into references
382+ for pkg in $(find . -name '*.rpm'); do
383+ echo "surface-dtx-daemon:$GIT_TAG/$(basename $pkg)" > $pkg.blob
384+ rm $pkg
385+ done
386+
387+ # set git identity
388+ git config --global user.email "[email protected] " 389+ git config --global user.name "surfacebot"
390+
391+ # commit and push
392+ update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
393+ git checkout -b "${update_branch}"
394+ git add .
395+ git commit -m "Update Fedora 33 DTX daemon"
396+ git push --set-upstream origin "${update_branch}"
397+
300398 repo-f32 :
301399 name : Update Fedora 32 package repository
302400 needs : [release]
0 commit comments