diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1eed49..741f7ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,12 +4,17 @@ on: push: tags: ["v*"] workflow_dispatch: + inputs: + tag: + description: "Existing tag: only build its pacman package and attach it to that release" + required: false permissions: contents: write jobs: linux-static: + if: ${{ !inputs.tag }} # oldest supported LTS runner = broadest glibc compatibility runs-on: ubuntu-22.04 steps: @@ -89,3 +94,47 @@ jobs: with: name: c64uv-linux-x86_64 path: c64uv-*-linux-x86_64.tar.gz + + arch-package: + runs-on: ubuntu-latest + container: archlinux:latest + env: + TAG: ${{ inputs.tag || (startsWith(github.ref, 'refs/tags/') && github.ref_name || '') }} + steps: + - name: Install build dependencies + run: pacman -Syu --noconfirm base-devel github-cli sdl3 curl iputils hicolor-icon-theme + + - uses: actions/checkout@v4 + + # Build the tag itself: the in-tree PKGBUILD still points at the + # previous release until it is bumped afterwards. + - name: Point PKGBUILD at the tag + if: env.TAG != '' + working-directory: packaging/aur + run: | + sed -i "s/^pkgver=.*/pkgver=${TAG#v}/; s/^pkgrel=.*/pkgrel=1/" PKGBUILD + sed -i "s/^sha256sums=.*/sha256sums=('SKIP')/" PKGBUILD + + - name: Build package + working-directory: packaging/aur + run: | + useradd -m builder + chown -R builder . + su builder -c "makepkg --noconfirm" + + - name: Upload to release + if: env.TAG != '' + working-directory: packaging/aur + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + gh release create "$TAG" --generate-notes || true + gh release upload "$TAG" c64uv-*.pkg.tar.zst --clobber + + - name: Upload artifact (non-tag runs) + if: env.TAG == '' + uses: actions/upload-artifact@v4 + with: + name: c64uv-arch-package + path: packaging/aur/c64uv-*.pkg.tar.zst diff --git a/CLAUDE.md b/CLAUDE.md index 8cc31b6..eab130d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -33,7 +33,10 @@ Packaging: `make install` (DESTDIR/PREFIX) installs the binary plus `tools/genicon.py`, which rasterises font8x8.h - never hand-edit the SVG). `packaging/aur/PKGBUILD` builds from the GitHub tag tarball, so it can only reference tags that already contain the packaging files; bump `pkgver` and -`sha256sums` on release. `SDL_SetAppMetadata` identifier and the desktop +`sha256sums` on release (the release workflow builds the .pkg.tar.zst from +the pushed tag itself, overriding pkgver, so a stale PKGBUILD never blocks +it; a manual run with the `tag` input does the same for an existing +release). `SDL_SetAppMetadata` identifier and the desktop file basename must both stay `c64uv` or desktops lose the window icon. ``` diff --git a/README.md b/README.md index f0bbd6e..be301e2 100644 --- a/README.md +++ b/README.md @@ -154,12 +154,22 @@ only; pair with `tools/mockstream.py` to develop with no hardware). ### Installing `make install` (respects `DESTDIR` and `PREFIX`, default `/usr`) installs the -binary, a desktop entry, and the icon. Arch users can build a package from -`packaging/aur/PKGBUILD`; prebuilt static binaries are on the +binary, a desktop entry, and the icon. Prebuilt static binaries are on the [releases page](https://github.com/crustovsky/C64UV/releases). Set `C64U_HOST` in your environment if you launch it from the desktop menu rather than a terminal. +On Arch (x86_64), download `c64uv--1-x86_64.pkg.tar.zst` from the +[latest release](https://github.com/crustovsky/C64UV/releases/latest) and +install it with pacman: + +```sh +sudo pacman -U c64uv-*-x86_64.pkg.tar.zst +``` + +`pacman -R c64uv` removes it. To build the package yourself instead (e.g. on +aarch64), run `makepkg -si` in `packaging/aur`. + ## Limitations - On current official firmware, typed input goes through the KERNAL keyboard diff --git a/packaging/aur/PKGBUILD b/packaging/aur/PKGBUILD index b3f62da..d615f70 100644 --- a/packaging/aur/PKGBUILD +++ b/packaging/aur/PKGBUILD @@ -7,6 +7,7 @@ arch=('x86_64' 'aarch64') url="https://github.com/crustovsky/C64UV" license=('MIT') depends=('sdl3' 'curl' 'iputils' 'hicolor-icon-theme') +options=('!debug') source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz") sha256sums=('3cb199684ff592404066105561e16236f8995d20d49c96dde73ef97edcf5d214')