gpur 0.8.1

btop-style GPU monitor TUI — NVIDIA, AMD, Apple Silicon; Linux, macOS, Windows
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
name: CI

# Release jobs live in this file (not an `on: release` workflow) because
# releases created with GITHUB_TOKEN do not fire downstream triggers.

on:
  pull_request:
  push:
    branches: [main]
    tags: ["v*"]
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          components: rustfmt
          cache: false
      - run: rustup update --no-self-update stable
      - run: cargo fmt --all --check

  clippy:
    name: clippy ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          components: clippy
          cache: false
      - run: rustup update --no-self-update stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-targets --all-features --locked -- -D warnings

  machete:
    name: cargo-machete (unused deps)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-machete
      - run: cargo machete

  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-deny
      - run: cargo deny --all-features check

  test:
    name: test ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          cache: false
      - run: rustup update --no-self-update stable
      - uses: Swatinem/rust-cache@v2
      - uses: taiki-e/install-action@nextest
      - run: cargo nextest run --all-features --locked --no-fail-fast

  smoke:
    name: build + smoke ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          cache: false
      - run: rustup update --no-self-update stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --locked
      - run: cargo run --locked -- --version
      - run: cargo run --locked -- --help
      # Probe the REAL backends (no --mock): partial hardware validation for
      # free. Runners mostly have no usable GPU, which must take the graceful
      # "no supported GPU backend" exit — a panic or any other failure is a
      # real bug. macOS arm64 runners expose a paravirt IOAccelerator and may
      # return actual data.
      - name: Probe real backends (tolerant)
        shell: bash
        run: |
          set +e
          out=$(cargo run --locked -- --once --tick-ms 100 2>&1)
          code=$?
          echo "$out"
          if [ $code -eq 0 ]; then
            echo "== real backend returned data =="
          elif echo "$out" | grep -q "no supported GPU backend"; then
            echo "== graceful no-backend path OK =="
          else
            echo "== unexpected failure (exit $code) =="
            exit 1
          fi

  # Runs on every main push (dry-run) and every v* tag / dispatch. Skips
  # PRs. Artifact upload happens always; publishing to the GitHub Release
  # is a separate tag-gated job. This catches packaging breakage before a
  # tag is cut.
  build:
    name: Build ${{ matrix.target }}
    needs: [test]
    if: github.event_name != 'pull_request'
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
            zigbuild_target: x86_64-unknown-linux-gnu.2.28
            zig: "true"
            macos_min: ""
            suffix: ""
            archive: tar.gz
            deb: "true"
            rpm: "true"
          - os: ubuntu-latest
            target: aarch64-unknown-linux-gnu
            zigbuild_target: aarch64-unknown-linux-gnu.2.28
            zig: "true"
            macos_min: ""
            suffix: ""
            archive: tar.gz
            deb: "true"
            rpm: "true"
          - os: ubuntu-latest
            target: x86_64-unknown-linux-musl
            zigbuild_target: x86_64-unknown-linux-musl
            zig: "true"
            macos_min: ""
            suffix: ""
            archive: tar.gz
            deb: "false"
            rpm: "false"
          - os: ubuntu-latest
            target: aarch64-unknown-linux-musl
            zigbuild_target: aarch64-unknown-linux-musl
            zig: "true"
            macos_min: ""
            suffix: ""
            archive: tar.gz
            deb: "false"
            rpm: "false"
          - os: windows-latest
            target: x86_64-pc-windows-msvc
            zigbuild_target: ""
            zig: "false"
            macos_min: ""
            suffix: ".exe"
            archive: zip
            deb: "false"
            rpm: "false"
          - os: macos-latest
            target: aarch64-apple-darwin
            zigbuild_target: ""
            zig: "false"
            macos_min: "11.0"
            suffix: ""
            archive: tar.gz
            deb: "false"
            rpm: "false"
          - os: macos-latest
            target: x86_64-apple-darwin
            zigbuild_target: ""
            zig: "false"
            macos_min: "10.15"
            suffix: ""
            archive: tar.gz
            deb: "false"
            rpm: "false"
    steps:
      - uses: actions/checkout@v7
      - name: Verify tag matches Cargo.toml version
        if: startsWith(github.ref, 'refs/tags/v')
        shell: bash
        run: |
          CARGO_VERSION=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
          if [ "v$CARGO_VERSION" != "$GITHUB_REF_NAME" ]; then
            echo "tag $GITHUB_REF_NAME != Cargo.toml version $CARGO_VERSION"
            exit 1
          fi
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          target: ${{ matrix.target }}
          cache: false
      - run: rustup update --no-self-update stable
      - run: rustup target add ${{ matrix.target }}
      - uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}
      - name: Setup zig
        if: matrix.zig == 'true'
        uses: mlugg/setup-zig@v2
        with:
          version: "0.15.1"
      - name: Install cargo-zigbuild
        if: matrix.zig == 'true'
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-zigbuild
      - name: Build binary (zigbuild)
        if: matrix.zig == 'true'
        run: cargo zigbuild --release --locked --target ${{ matrix.zigbuild_target }} --bin gpur
      - name: Build binary (native)
        if: matrix.zig == 'false'
        env:
          MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_min }}
        run: cargo build --release --locked --target ${{ matrix.target }} --bin gpur
      - name: Smoke artifact
        if: matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'aarch64-apple-darwin'
        run: ./target/${{ matrix.target }}/release/gpur --version
      - name: Package (Linux / macOS)
        if: matrix.archive == 'tar.gz'
        shell: bash
        run: |
          TAG=${GITHUB_REF_NAME}
          ARCHIVE="gpur-${TAG}-${{ matrix.target }}.tar.gz"
          mkdir -p dist
          cp target/${{ matrix.target }}/release/gpur dist/
          cp README.md LICENSE dist/
          tar -czf "$ARCHIVE" -C dist .
          if command -v sha256sum >/dev/null 2>&1; then
            sha256sum "$ARCHIVE" > "$ARCHIVE.sha256"
          else
            shasum -a 256 "$ARCHIVE" > "$ARCHIVE.sha256"
          fi
      - name: Package (Windows)
        if: matrix.archive == 'zip'
        shell: pwsh
        run: |
          $tag = $env:GITHUB_REF_NAME
          $archive = "gpur-$tag-${{ matrix.target }}.zip"
          New-Item -ItemType Directory -Force dist | Out-Null
          Copy-Item target/${{ matrix.target }}/release/gpur.exe dist/
          Copy-Item README.md, LICENSE dist/
          Compress-Archive -Path dist/* -DestinationPath $archive
          $hash = (Get-FileHash $archive -Algorithm SHA256).Hash.ToLower()
          "$hash  $archive" | Out-File -Encoding ascii "$archive.sha256"
      - name: Install cargo-deb
        if: matrix.deb == 'true'
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-deb
      - name: Build .deb
        if: matrix.deb == 'true'
        run: |
          cargo deb --target ${{ matrix.target }} --no-build --no-strip
          DEB_FILE=$(ls target/${{ matrix.target }}/debian/gpur_*.deb | head -1)
          cp "$DEB_FILE" .
          sha256sum "$(basename "$DEB_FILE")" > "$(basename "$DEB_FILE").sha256"
      - name: Install cargo-generate-rpm
        if: matrix.rpm == 'true'
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-generate-rpm
      - name: Build .rpm
        if: matrix.rpm == 'true'
        run: |
          cargo generate-rpm --target ${{ matrix.target }} --payload-compress none
          RPM_FILE=$(ls target/${{ matrix.target }}/generate-rpm/gpur-*.rpm | head -1)
          cp "$RPM_FILE" .
          sha256sum "$(basename "$RPM_FILE")" > "$(basename "$RPM_FILE").sha256"
      - uses: actions/upload-artifact@v4
        with:
          name: gpur-${{ matrix.target }}
          path: |
            gpur-*.tar.gz
            gpur-*.tar.gz.sha256
            gpur-*.zip
            gpur-*.zip.sha256
            gpur_*.deb
            gpur_*.deb.sha256
            gpur-*.rpm
            gpur-*.rpm.sha256

  publish-github-release:
    name: Publish GitHub Release
    needs: [build, fmt, clippy, deny, machete]
    if: >-
      github.event_name == 'workflow_dispatch' ||
      (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/download-artifact@v4
        with:
          pattern: gpur-*
          merge-multiple: true
          path: dist
      - name: Generate completions + man page
        run: |
          # Archive entries are prefixed ./ (tar -C dist .)
          tar -xzf dist/gpur-${GITHUB_REF_NAME}-x86_64-unknown-linux-gnu.tar.gz ./gpur
          mkdir -p pkgext/completions
          for shell in bash zsh fish powershell elvish nushell; do
            ./gpur --completions "$shell" > "pkgext/completions/gpur.$shell"
          done
          ./gpur --man > pkgext/gpur.1
          tar -C pkgext -czf dist/gpur-${GITHUB_REF_NAME}-completions-man.tar.gz .
      - uses: softprops/action-gh-release@v3
        with:
          files: dist/*
          fail_on_unmatched_files: true
          generate_release_notes: true
          prerelease: ${{ contains(github.ref_name, '-') }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  publish-crates:
    name: Publish to crates.io
    needs: [publish-github-release]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable
          cache: false
      - name: Publish (idempotent)
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          set -euo pipefail
          VERSION=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
          # NB: crates.io 403s UA-less requests — the probe must send a
          # User-Agent or it never detects an already-published version.
          if curl -fsS -A "gpur-release-ci" -o /dev/null "https://crates.io/api/v1/crates/gpur/$VERSION"; then
            echo "gpur $VERSION already on crates.io — skipping"
            exit 0
          fi
          # Publish with hjkl-style 429 retries: parse crates.io's
          # "try again after" timestamp (11-min fallback), 3 attempts;
          # non-rate-limit failures fail fast.
          attempt=0
          while [ $attempt -lt 3 ]; do
            if cargo publish --locked 2>&1 | tee /tmp/publish.log; then
              exit 0
            fi
            if grep -qiE "429|Too Many Requests" /tmp/publish.log; then
              wait_until=$(grep -oE 'try again after [^.]+' /tmp/publish.log | sed 's/try again after //' || true)
              if [ -n "$wait_until" ]; then
                wait_secs=$(( $(date -d "$wait_until" +%s) - $(date +%s) + 30 ))
                [ "$wait_secs" -lt 30 ] && wait_secs=30
                echo "::warning::rate limited, sleeping ${wait_secs}s until $wait_until"
              else
                wait_secs=660
                echo "::warning::rate limited, sleeping ${wait_secs}s (11 min fallback)"
              fi
              sleep "$wait_secs"
              attempt=$(( attempt + 1 ))
            else
              echo "::error::publish failed (non-rate-limit error)"
              exit 1
            fi
          done
          echo "::error::publish failed after 3 rate-limit retries"
          exit 1

  aur-bin:
    name: Publish AUR (gpur-bin)
    needs: [publish-github-release]
    runs-on: ubuntu-latest
    container: archlinux:latest
    steps:
      - name: Install deps
        run: pacman -Sy --noconfirm --needed base-devel git openssh curl
      - uses: actions/checkout@v7
      - name: Resolve version
        id: tag
        run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
      - name: Render PKGBUILD
        run: |
          VERSION=${{ steps.tag.outputs.version }}
          BASE="https://github.com/kryptic-sh/gpur/releases/download/v${VERSION}"
          SHA_X86=$(curl -sL "$BASE/gpur-v${VERSION}-x86_64-unknown-linux-gnu.tar.gz.sha256" | awk '{print $1}')
          SHA_A64=$(curl -sL "$BASE/gpur-v${VERSION}-aarch64-unknown-linux-gnu.tar.gz.sha256" | awk '{print $1}')
          test -n "$SHA_X86" && test -n "$SHA_A64"
          mkdir -p out
          sed -e "s/{VERSION}/${VERSION}/g" \
              -e "s/{SHA256_X86_64}/${SHA_X86}/g" \
              -e "s/{SHA256_AARCH64}/${SHA_A64}/g" \
              pkg/aur/PKGBUILD-bin.in > out/PKGBUILD
      - name: Generate .SRCINFO
        run: |
          useradd -m builder
          chown -R builder out
          su -s /bin/bash builder -c 'cd out && makepkg --printsrcinfo > .SRCINFO'
      - name: Push to AUR
        env:
          GIT_SSH_COMMAND: "ssh -i ~/.ssh/aur -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=~/.ssh/known_hosts"
        run: |
          mkdir -p ~/.ssh
          echo "${{ secrets.AUR_SSH_KEY }}" > ~/.ssh/aur
          chmod 600 ~/.ssh/aur
          git config --global user.name  "gpur-ci"
          git config --global user.email "ci@kryptic.sh"
          git clone ssh://aur@aur.archlinux.org/gpur-bin.git aur-repo
          cp out/PKGBUILD out/.SRCINFO aur-repo/
          cp pkg/aur/LICENSE pkg/aur/.gitignore aur-repo/
          cd aur-repo
          git add PKGBUILD .SRCINFO LICENSE .gitignore
          if git diff --cached --quiet; then echo "nothing to push"; exit 0; fi
          git commit -m "gpur-bin ${{ steps.tag.outputs.version }}-1"
          git push origin master

  brew-tap:
    name: Publish Homebrew formula
    needs: [publish-github-release]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - name: Resolve version
        id: tag
        run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
      - name: Render formula
        run: |
          VERSION=${{ steps.tag.outputs.version }}
          BASE="https://github.com/kryptic-sh/gpur/releases/download/v${VERSION}"
          SHA_ARM=$(curl -sL "$BASE/gpur-v${VERSION}-aarch64-apple-darwin.tar.gz.sha256" | awk '{print $1}')
          SHA_X86=$(curl -sL "$BASE/gpur-v${VERSION}-x86_64-apple-darwin.tar.gz.sha256" | awk '{print $1}')
          test -n "$SHA_ARM" && test -n "$SHA_X86"
          mkdir -p out
          sed -e "s/{VERSION}/${VERSION}/g" \
              -e "s/{SHA256_AARCH64_DARWIN}/${SHA_ARM}/g" \
              -e "s/{SHA256_X86_64_DARWIN}/${SHA_X86}/g" \
              pkg/homebrew/gpur.rb.in > out/gpur.rb
      - name: Push to tap
        env:
          GIT_SSH_COMMAND: "ssh -i ~/.ssh/brew -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=~/.ssh/known_hosts"
        run: |
          mkdir -p ~/.ssh
          echo "${{ secrets.BREW_SSH_KEY }}" > ~/.ssh/brew
          chmod 600 ~/.ssh/brew
          git config --global user.name  "gpur-ci"
          git config --global user.email "ci@kryptic.sh"
          git clone git@github.com:kryptic-sh/homebrew-tap.git tap
          mkdir -p tap/Formula
          cp out/gpur.rb tap/Formula/gpur.rb
          cd tap
          git add Formula/gpur.rb
          if git diff --cached --quiet; then echo "nothing to push"; exit 0; fi
          git commit -m "gpur ${{ steps.tag.outputs.version }}"
          git push origin HEAD:main

  scoop-bucket:
    name: Publish Scoop manifest
    needs: [publish-github-release]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - name: Resolve version
        id: tag
        run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
      - name: Render manifest
        run: |
          VERSION=${{ steps.tag.outputs.version }}
          BASE="https://github.com/kryptic-sh/gpur/releases/download/v${VERSION}"
          SHA_WIN=$(curl -sL "$BASE/gpur-v${VERSION}-x86_64-pc-windows-msvc.zip.sha256" | awk '{print $1}')
          test -n "$SHA_WIN"
          mkdir -p out
          sed -e "s/{VERSION}/${VERSION}/g" \
              -e "s/{SHA256_X86_64_WINDOWS}/${SHA_WIN}/g" \
              pkg/scoop/gpur.json.in > out/gpur.json
      - name: Push to bucket
        env:
          GIT_SSH_COMMAND: "ssh -i ~/.ssh/scoop -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=~/.ssh/known_hosts"
        run: |
          mkdir -p ~/.ssh
          echo "${{ secrets.SCOOP_SSH_KEY }}" > ~/.ssh/scoop
          chmod 600 ~/.ssh/scoop
          git config --global user.name  "gpur-ci"
          git config --global user.email "ci@kryptic.sh"
          git clone git@github.com:kryptic-sh/scoop-bucket.git bucket
          mkdir -p bucket/bucket
          cp out/gpur.json bucket/bucket/gpur.json
          cd bucket
          git add bucket/gpur.json
          if git diff --cached --quiet; then echo "nothing to push"; exit 0; fi
          git commit -m "gpur ${{ steps.tag.outputs.version }}"
          git push origin HEAD:main

  alpine:
    name: Publish Alpine .apk
    needs: [publish-github-release]
    runs-on: ubuntu-latest
    container: alpine:latest
    permissions:
      contents: write
    steps:
      - name: Install deps
        run: apk add --no-cache alpine-sdk bash curl coreutils
      - uses: actions/checkout@v7
      - name: Resolve version
        id: tag
        run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
      - name: Render APKBUILD
        run: |
          VERSION=${{ steps.tag.outputs.version }}
          BASE="https://github.com/kryptic-sh/gpur/releases/download/v${VERSION}"
          curl -sLO "$BASE/gpur-v${VERSION}-x86_64-unknown-linux-musl.tar.gz"
          SHA512=$(sha512sum "gpur-v${VERSION}-x86_64-unknown-linux-musl.tar.gz" | awk '{print $1}')
          mkdir -p out
          sed -e "s/{VERSION}/${VERSION}/g" \
              -e "s/{SHA512_X86_64}/${SHA512}/g" \
              pkg/alpine/APKBUILD.in > out/APKBUILD
      - name: Build .apk
        run: |
          adduser -D builder
          addgroup builder abuild
          mkdir -p /var/cache/distfiles
          chmod a+w /var/cache/distfiles
          cp "gpur-v${{ steps.tag.outputs.version }}-x86_64-unknown-linux-musl.tar.gz" /var/cache/distfiles/
          chown -R builder out
          su builder -c 'abuild-keygen -a -n'
          # Install the pubkey BEFORE building or index signing fails.
          cp /home/builder/.abuild/*.rsa.pub /etc/apk/keys/
          su builder -c "cd $PWD/out && abuild -F -r"
          APK=$(find /home/builder/packages -name 'gpur-*.apk' | head -1)
          cp "$APK" .
          sha256sum "$(basename "$APK")" > "$(basename "$APK").sha256"
      - name: Upload .apk to release
        uses: softprops/action-gh-release@v3
        with:
          files: |
            gpur-*.apk
            gpur-*.apk.sha256
          fail_on_unmatched_files: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}