|
78 | 78 | name: debian-latest |
79 | 79 | path: release |
80 | 80 |
|
| 81 | + build-f36: |
| 82 | + name: Build Fedora 36 package |
| 83 | + runs-on: ubuntu-latest |
| 84 | + container: |
| 85 | + image: fedora:36 |
| 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-36-latest |
| 137 | + path: pkg/fedora/release |
| 138 | + |
81 | 139 | build-f35: |
82 | 140 | name: Build Fedora 35 package |
83 | 141 | runs-on: ubuntu-latest |
@@ -194,14 +252,19 @@ jobs: |
194 | 252 |
|
195 | 253 | release: |
196 | 254 | name: Publish release |
197 | | - needs: [build-deb, build-f35, build-f34] |
| 255 | + needs: [build-deb, build-f36, build-f35, build-f34] |
198 | 256 | runs-on: ubuntu-latest |
199 | 257 | steps: |
200 | 258 | - name: Download Debian artifacts |
201 | 259 | uses: actions/download-artifact@v1 |
202 | 260 | with: |
203 | 261 | name: debian-latest |
204 | 262 |
|
| 263 | + - name: Download Fedora 36 artifacts |
| 264 | + uses: actions/download-artifact@v1 |
| 265 | + with: |
| 266 | + name: fedora-36-latest |
| 267 | + |
205 | 268 | - name: Download Fedora 35 artifacts |
206 | 269 | uses: actions/download-artifact@v1 |
207 | 270 | with: |
@@ -272,6 +335,58 @@ jobs: |
272 | 335 | git commit -m "Update Debian libwacom" |
273 | 336 | git push --set-upstream origin "${update_branch}" |
274 | 337 |
|
| 338 | + repo-f36: |
| 339 | + name: Update Fedora 36 package repository |
| 340 | + needs: [release] |
| 341 | + runs-on: ubuntu-latest |
| 342 | + container: |
| 343 | + image: fedora:36 |
| 344 | + options: --security-opt seccomp=unconfined |
| 345 | + steps: |
| 346 | + - name: Install dependencies |
| 347 | + run: | |
| 348 | + dnf install -y git findutils |
| 349 | +
|
| 350 | + - name: Download artifacts |
| 351 | + uses: actions/download-artifact@v1 |
| 352 | + with: |
| 353 | + name: fedora-36-latest |
| 354 | + |
| 355 | + - name: Update repository |
| 356 | + env: |
| 357 | + SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} |
| 358 | + BRANCH_STAGING: u/staging |
| 359 | + GIT_REF: ${{ github.ref }} |
| 360 | + run: | |
| 361 | + repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git" |
| 362 | +
|
| 363 | + # clone package repository |
| 364 | + git clone -b "${BRANCH_STAGING}" "${repo}" repo |
| 365 | +
|
| 366 | + # copy packages |
| 367 | + cp fedora-36-latest/* repo/fedora/f36 |
| 368 | + cd repo/fedora/f36 |
| 369 | +
|
| 370 | + # parse git tag from ref |
| 371 | + GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g') |
| 372 | +
|
| 373 | + # convert packages into references |
| 374 | + for pkg in $(find . -name '*.rpm'); do |
| 375 | + echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob |
| 376 | + rm $pkg |
| 377 | + done |
| 378 | +
|
| 379 | + # set git identity |
| 380 | + git config --global user.email "[email protected]" |
| 381 | + git config --global user.name "surfacebot" |
| 382 | +
|
| 383 | + # commit and push |
| 384 | + update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" |
| 385 | + git checkout -b "${update_branch}" |
| 386 | + git add . |
| 387 | + git commit -m "Update Fedora 36 libwacom" |
| 388 | + git push --set-upstream origin "${update_branch}" |
| 389 | +
|
275 | 390 | repo-f35: |
276 | 391 | name: Update Fedora 35 package repository |
277 | 392 | needs: [release] |
|
0 commit comments