|
53 | 53 | name: debian-latest |
54 | 54 | path: release |
55 | 55 |
|
| 56 | + build-f33: |
| 57 | + name: Build Fedora 33 package |
| 58 | + runs-on: ubuntu-latest |
| 59 | + container: fedora:33 |
| 60 | + steps: |
| 61 | + - name: Checkout code |
| 62 | + uses: actions/checkout@v2 |
| 63 | + |
| 64 | + - name: Install build dependencies |
| 65 | + run: | |
| 66 | + dnf distro-sync -y |
| 67 | + dnf install -y rpmdevtools rpm-sign 'dnf-command(builddep)' |
| 68 | + dnf builddep -y pkg/fedora/libwacom-surface.spec |
| 69 | +
|
| 70 | + - name: Build package |
| 71 | + run: | |
| 72 | + cd pkg/fedora |
| 73 | +
|
| 74 | + # Build the .rpm packages |
| 75 | + ./makerpm |
| 76 | +
|
| 77 | + - name: Sign packages |
| 78 | + env: |
| 79 | + GPG_KEY_ID: 56C464BAAC421453 |
| 80 | + GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }} |
| 81 | + run: | |
| 82 | + cd pkg/fedora/out |
| 83 | +
|
| 84 | + # import GPG key |
| 85 | + echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes |
| 86 | +
|
| 87 | + # sign package |
| 88 | + cd noarch |
| 89 | + rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" |
| 90 | +
|
| 91 | + cd .. |
| 92 | +
|
| 93 | + cd x86_64 |
| 94 | + rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID" |
| 95 | +
|
| 96 | + - name: Prepare artifacts |
| 97 | + run: | |
| 98 | + cd pkg/fedora |
| 99 | + mkdir release |
| 100 | +
|
| 101 | + cp out/noarch/* release/ |
| 102 | + cp out/x86_64/* release/ |
| 103 | +
|
| 104 | + rm release/libwacom-surface-devel-* |
| 105 | +
|
| 106 | + - name: Upload artifacts |
| 107 | + uses: actions/upload-artifact@v1 |
| 108 | + with: |
| 109 | + name: fedora-33-latest |
| 110 | + path: pkg/fedora/release |
| 111 | + |
56 | 112 | build-f32: |
57 | 113 | name: Build Fedora 32 package |
58 | 114 | runs-on: ubuntu-latest |
@@ -167,14 +223,19 @@ jobs: |
167 | 223 |
|
168 | 224 | release: |
169 | 225 | name: Publish release |
170 | | - needs: [build-deb, build-f32, build-f31] |
| 226 | + needs: [build-deb, build-f33, build-f32, build-f31] |
171 | 227 | runs-on: ubuntu-latest |
172 | 228 | steps: |
173 | 229 | - name: Download Debian artifacts |
174 | 230 | uses: actions/download-artifact@v1 |
175 | 231 | with: |
176 | 232 | name: debian-latest |
177 | 233 |
|
| 234 | + - name: Download Fedora 33 artifacts |
| 235 | + uses: actions/download-artifact@v1 |
| 236 | + with: |
| 237 | + name: fedora-33-latest |
| 238 | + |
178 | 239 | - name: Download Fedora 32 artifacts |
179 | 240 | uses: actions/download-artifact@v1 |
180 | 241 | with: |
@@ -245,6 +306,56 @@ jobs: |
245 | 306 | git commit -m "Update Debian libwacom" |
246 | 307 | git push --set-upstream origin "${update_branch}" |
247 | 308 |
|
| 309 | + repo-f33: |
| 310 | + name: Update Fedora 33 package repository |
| 311 | + needs: [release] |
| 312 | + runs-on: ubuntu-latest |
| 313 | + container: fedora:33 |
| 314 | + steps: |
| 315 | + - name: Install dependencies |
| 316 | + run: | |
| 317 | + dnf install -y git findutils |
| 318 | +
|
| 319 | + - name: Download artifacts |
| 320 | + uses: actions/download-artifact@v1 |
| 321 | + with: |
| 322 | + name: fedora-33-latest |
| 323 | + |
| 324 | + - name: Update repository |
| 325 | + env: |
| 326 | + SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} |
| 327 | + BRANCH_STAGING: u/staging |
| 328 | + GIT_REF: ${{ github.ref }} |
| 329 | + run: | |
| 330 | + repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git" |
| 331 | +
|
| 332 | + # clone package repository |
| 333 | + git clone -b "${BRANCH_STAGING}" "${repo}" repo |
| 334 | +
|
| 335 | + # copy packages |
| 336 | + cp fedora-33-latest/* repo/fedora/f33 |
| 337 | + cd repo/fedora/f33 |
| 338 | +
|
| 339 | + # parse git tag from ref |
| 340 | + GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g') |
| 341 | +
|
| 342 | + # convert packages into references |
| 343 | + for pkg in $(find . -name '*.rpm'); do |
| 344 | + echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob |
| 345 | + rm $pkg |
| 346 | + done |
| 347 | +
|
| 348 | + # set git identity |
| 349 | + git config --global user.email "[email protected]" |
| 350 | + git config --global user.name "surfacebot" |
| 351 | +
|
| 352 | + # commit and push |
| 353 | + update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)" |
| 354 | + git checkout -b "${update_branch}" |
| 355 | + git add . |
| 356 | + git commit -m "Update Fedora 33 libwacom" |
| 357 | + git push --set-upstream origin "${update_branch}" |
| 358 | +
|
248 | 359 | repo-f32: |
249 | 360 | name: Update Fedora 32 package repository |
250 | 361 | needs: [release] |
|
0 commit comments