|
78 | 78 | name: debian-latest |
79 | 79 | path: release |
80 | 80 |
|
| 81 | + build-f37: |
| 82 | + name: Build Fedora 37 package |
| 83 | + runs-on: ubuntu-latest |
| 84 | + container: |
| 85 | + image: registry.fedoraproject.org/fedora:37 |
| 86 | + options: --security-opt seccomp=unconfined |
| 87 | + steps: |
| 88 | + - name: Checkout code |
| 89 | + uses: actions/checkout@v2 |
| 90 | + |
| 91 | + - name: Install build dependencies |
| 92 | + run: | |
| 93 | + dnf distro-sync -y |
| 94 | + dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)' |
| 95 | + dnf builddep -y pkg/fedora/libwacom-surface.spec |
| 96 | +
|
| 97 | + - name: Build package |
| 98 | + run: | |
| 99 | + cd pkg/fedora |
| 100 | +
|
| 101 | + # Build the .rpm packages |
| 102 | + ./makerpm |
| 103 | +
|
| 104 | + - name: Sign packages |
| 105 | + env: |
| 106 | + GPG_KEY_ID: 56C464BAAC421453 |
| 107 | + GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }} |
| 108 | + run: | |
| 109 | + cd pkg/fedora/out |
| 110 | +
|
| 111 | + # import GPG key |
| 112 | + echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes |
| 113 | +
|
| 114 | + # sign package |
| 115 | + cd noarch |
| 116 | + rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" |
| 117 | +
|
| 118 | + cd .. |
| 119 | +
|
| 120 | + cd x86_64 |
| 121 | + rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" |
| 122 | +
|
| 123 | + - name: Prepare artifacts |
| 124 | + run: | |
| 125 | + cd pkg/fedora |
| 126 | + mkdir release |
| 127 | +
|
| 128 | + cp out/noarch/* release/ |
| 129 | + cp out/x86_64/* release/ |
| 130 | +
|
| 131 | + rm release/libwacom-surface-devel-* |
| 132 | +
|
| 133 | + - name: Upload artifacts |
| 134 | + uses: actions/upload-artifact@v1 |
| 135 | + with: |
| 136 | + name: fedora-37-latest |
| 137 | + path: pkg/fedora/release |
| 138 | + |
81 | 139 | build-f36: |
82 | 140 | name: Build Fedora 36 package |
83 | 141 | runs-on: ubuntu-latest |
@@ -196,14 +254,19 @@ jobs: |
196 | 254 |
|
197 | 255 | release: |
198 | 256 | name: Publish release |
199 | | - needs: [build-deb, build-f36, build-f35] |
| 257 | + needs: [build-deb, build-f37, build-f36, build-f35] |
200 | 258 | runs-on: ubuntu-latest |
201 | 259 | steps: |
202 | 260 | - name: Download Debian artifacts |
203 | 261 | uses: actions/download-artifact@v1 |
204 | 262 | with: |
205 | 263 | name: debian-latest |
206 | 264 |
|
| 265 | + - name: Download Fedora 37 artifacts |
| 266 | + uses: actions/download-artifact@v1 |
| 267 | + with: |
| 268 | + name: fedora-37-latest |
| 269 | + |
207 | 270 | - name: Download Fedora 36 artifacts |
208 | 271 | uses: actions/download-artifact@v1 |
209 | 272 | with: |
@@ -274,6 +337,58 @@ jobs: |
274 | 337 | git commit -m "Update Debian libwacom" |
275 | 338 | git push --set-upstream origin "${update_branch}" |
276 | 339 |
|
| 340 | + repo-f37: |
| 341 | + name: Update Fedora 37 package repository |
| 342 | + needs: [release] |
| 343 | + runs-on: ubuntu-latest |
| 344 | + container: |
| 345 | + image: registry.fedoraproject.org/fedora:37 |
| 346 | + options: --security-opt seccomp=unconfined |
| 347 | + steps: |
| 348 | + - name: Install dependencies |
| 349 | + run: | |
| 350 | + dnf install -y git findutils |
| 351 | +
|
| 352 | + - name: Download artifacts |
| 353 | + uses: actions/download-artifact@v1 |
| 354 | + with: |
| 355 | + name: fedora-37-latest |
| 356 | + |
| 357 | + - name: Update repository |
| 358 | + env: |
| 359 | + SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} |
| 360 | + BRANCH_STAGING: u/staging |
| 361 | + GIT_REF: ${{ github.ref }} |
| 362 | + run: | |
| 363 | + repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git" |
| 364 | +
|
| 365 | + # clone package repository |
| 366 | + git clone -b "${BRANCH_STAGING}" "${repo}" repo |
| 367 | +
|
| 368 | + # copy packages |
| 369 | + cp fedora-37-latest/* repo/fedora/f37 |
| 370 | + cd repo/fedora/f37 |
| 371 | +
|
| 372 | + # parse git tag from ref |
| 373 | + GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g') |
| 374 | +
|
| 375 | + # convert packages into references |
| 376 | + for pkg in $(find . -name '*.rpm'); do |
| 377 | + echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob |
| 378 | + rm $pkg |
| 379 | + done |
| 380 | +
|
| 381 | + # set git identity |
| 382 | + git config --global user.email "[email protected]" |
| 383 | + git config --global user.name "surfacebot" |
| 384 | +
|
| 385 | + # commit and push |
| 386 | + update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" |
| 387 | + git checkout -b "${update_branch}" |
| 388 | + git add . |
| 389 | + git commit -m "Update Fedora 37 libwacom" |
| 390 | + git push --set-upstream origin "${update_branch}" |
| 391 | +
|
277 | 392 | repo-f36: |
278 | 393 | name: Update Fedora 36 package repository |
279 | 394 | needs: [release] |
|
0 commit comments