From b53e2be538c0eb840295e2eef986d305ed948e91 Mon Sep 17 00:00:00 2001 From: broisnees Date: Thu, 19 Nov 2026 09:58:31 +0000 Subject: [PATCH] Fix the stroke-bin PKGBUILD for .debs that already name the binary stroke Since 2.20 the .deb ships /usr/bin/stroke and stroke.png, so the unconditional mv of app failed and yay -S stroke-bin broke for everyone. The renames now run only when the old names are there. pkgrel is a template field, and aur.yml republishes a released version with a higher pkgrel. --- .github/workflows/aur.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 2 +- packaging/aur/stroke-bin/PKGBUILD.in | 15 +++++--- 3 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/aur.yml diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml new file mode 100644 index 00000000..5acf71c1 --- /dev/null +++ b/.github/workflows/aur.yml @@ -0,0 +1,52 @@ +# Republish stroke-bin to the AUR for a release that is already out, after a +# fix to packaging/aur/stroke-bin/PKGBUILD.in. Bump `pkgrel` (2, 3, ...) so +# yay and paru see a new package. release.yml publishes pkgrel 1 itself. +# +# Run it from Actions → Republish to the AUR → Run workflow. + +name: Republish to the AUR + +on: + workflow_dispatch: + inputs: + tag: + description: Released tag, e.g. v3.0.0 + required: true + pkgrel: + description: Package release (2 or higher) + required: true + default: '2' + +permissions: + contents: read + +jobs: + aur: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - name: Fill in the PKGBUILD + env: + TAG: ${{ inputs.tag }} + PKGREL: ${{ inputs.pkgrel }} + run: | + set -euo pipefail + [[ "$PKGREL" =~ ^[0-9]+$ ]] || { echo "::error::pkgrel must be a number"; exit 1; } + VERSION="${TAG#v}" + curl -fsSL -o stroke.deb "https://github.com/stroke-app/stroke/releases/download/${TAG}/stroke_${VERSION}_amd64.deb" + SHA=$(sha256sum stroke.deb | cut -d' ' -f1) + mkdir -p aur + sed -e "s/@VERSION@/${VERSION}/" -e "s/@PKGREL@/${PKGREL}/" -e "s/@SHA256@/${SHA}/" packaging/aur/stroke-bin/PKGBUILD.in > aur/PKGBUILD + cat aur/PKGBUILD + + - name: Push to the AUR + uses: KSXGitHub/github-actions-deploy-aur@v4.1.1 + with: + pkgname: stroke-bin + pkgbuild: aur/PKGBUILD + commit_username: broisnees + commit_email: broisnees@users.noreply.github.com + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: "Fix the package for ${{ inputs.tag }} (pkgrel ${{ inputs.pkgrel }})" + ssh_keyscan_types: rsa,ecdsa,ed25519 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f100c640..3cc6cf83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -465,7 +465,7 @@ jobs: curl -fsSL -o stroke.deb "$URL" SHA=$(sha256sum stroke.deb | cut -d' ' -f1) mkdir -p aur - sed -e "s/@VERSION@/${VERSION}/" -e "s/@SHA256@/${SHA}/" packaging/aur/stroke-bin/PKGBUILD.in > aur/PKGBUILD + sed -e "s/@VERSION@/${VERSION}/" -e "s/@PKGREL@/1/" -e "s/@SHA256@/${SHA}/" packaging/aur/stroke-bin/PKGBUILD.in > aur/PKGBUILD cat aur/PKGBUILD echo "skip=false" >> "$GITHUB_OUTPUT" diff --git a/packaging/aur/stroke-bin/PKGBUILD.in b/packaging/aur/stroke-bin/PKGBUILD.in index 8d3dfad5..8d499c42 100644 --- a/packaging/aur/stroke-bin/PKGBUILD.in +++ b/packaging/aur/stroke-bin/PKGBUILD.in @@ -3,7 +3,7 @@ # release, which fills in the version and the .deb checksum. pkgname=stroke-bin pkgver=@VERSION@ -pkgrel=1 +pkgrel=@PKGREL@ pkgdesc="Native database client for PostgreSQL, MySQL, SQLite, MongoDB, Redis and more, with an AI agent and an MCP server" arch=('x86_64') url="https://stroke.click" @@ -20,11 +20,16 @@ sha256sums=('@SHA256@' package() { bsdtar -xf data.tar.gz -C "$pkgdir" - # The .deb names its binary and icon "app"; on Arch that would collide with - # anything else called app, so both become "stroke". - mv "$pkgdir/usr/bin/app" "$pkgdir/usr/bin/stroke" + # Builds before 2.20 name the binary and icon "app"; on Arch that would + # collide with anything else called app, so both become "stroke". Newer + # .debs already ship them as "stroke". + if [[ -e "$pkgdir/usr/bin/app" ]]; then + mv "$pkgdir/usr/bin/app" "$pkgdir/usr/bin/stroke" + fi for icon in "$pkgdir"/usr/share/icons/hicolor/*/apps/app.png; do - mv "$icon" "${icon%/app.png}/stroke.png" + if [[ -e "$icon" ]]; then + mv "$icon" "${icon%/app.png}/stroke.png" + fi done sed -i -e 's/^Exec=app$/Exec=stroke/' \ -e 's/^Icon=app$/Icon=stroke/' \