Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/aur.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
15 changes: 10 additions & 5 deletions packaging/aur/stroke-bin/PKGBUILD.in
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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/' \
Expand Down
Loading