diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml index fbc014c..ab2b33a 100644 --- a/.github/workflows/aur.yml +++ b/.github/workflows/aur.yml @@ -10,6 +10,9 @@ jobs: publish: name: AUR Publish runs-on: ubuntu-latest + strategy: + matrix: + package: [rustmius, rustmius-bin, rustmius-git] steps: - name: Checkout code @@ -18,10 +21,10 @@ jobs: - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 with: - pkgname: rustmius-bin - pkgbuild: ./PKGBUILD + pkgname: ${{ matrix.package }} + pkgbuild: ./packages/${{ matrix.package }}/PKGBUILD commit_username: ${{ secrets.AUR_USERNAME }} commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} - commit_message: Update AUR package + commit_message: Update ${{ matrix.package }} ssh_keyscan_types: rsa,ecdsa,ed25519 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90b85d0..de0ea1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -168,50 +168,75 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} aur: - name: Update AUR + name: Update AUR (${{ matrix.package }}) needs: [prepare, build] runs-on: ubuntu-latest permissions: contents: write + strategy: + matrix: + package: [rustmius, rustmius-bin, rustmius-git] steps: - name: Checkout uses: actions/checkout@v6 - name: Download Artifacts + if: matrix.package == 'rustmius-bin' uses: actions/download-artifact@v8 with: name: binary-x86_64 path: . - - name: Update PKGBUILD + - name: Update PKGBUILD (rustmius-bin) + if: matrix.package == 'rustmius-bin' run: | VERSION="${{ needs.prepare.outputs.version_only }}" - HASH_DESKTOP=$(sha256sum rustmius.desktop | cut -d' ' -f1) - HASH_PNG=$(sha256sum rustmius.png | cut -d' ' -f1) + # Paths updated to packages/ subdirectory + HASH_DESKTOP=$(sha256sum packages/rustmius.desktop | cut -d' ' -f1) + HASH_PNG=$(sha256sum packages/rustmius.png | cut -d' ' -f1) HASH_LICENSE=$(sha256sum LICENSE | cut -d' ' -f1) HASH_BINARY=$(sha256sum rustmius-x86_64 | cut -d' ' -f1) + # Target the specific PKGBUILD in packages/rustmius-bin/ + TARGET="packages/rustmius-bin/PKGBUILD" awk -v v="$VERSION" -v d="$HASH_DESKTOP" -v p="$HASH_PNG" -v l="$HASH_LICENSE" -v b="$HASH_BINARY" ' BEGIN { h[0]=d; h[1]=p; h[2]=l; h[3]=b; i=0 } /^pkgver=/ { $0="pkgver=" v } /^pkgrel=/ { $0="pkgrel=1" } + /^pkgdesc=/ { $0="pkgdesc=\"Full local Termius alternative for Linux (GTK4) - binary release\"" } /'\''[0-9a-f]{64}'\''/ && i < 4 { sub(/'\''[0-9a-f]{64}'\''/, "'\''" h[i++] "'\''") } { print } - ' PKGBUILD > PKGBUILD.tmp && mv PKGBUILD.tmp PKGBUILD + ' "$TARGET" > "$TARGET.tmp" && mv "$TARGET.tmp" "$TARGET" - - name: Commit and Push PKGBUILD + - name: Update PKGBUILD (rustmius) + if: matrix.package == 'rustmius' + run: | + VERSION="${{ needs.prepare.outputs.version_only }}" + # Get source archive hash + URL="https://github.com/Cleboost/Rustmius/archive/v$VERSION.tar.gz" + curl -L -o source.tar.gz "$URL" + HASH_SOURCE=$(sha256sum source.tar.gz | cut -d' ' -f1) + + TARGET="packages/rustmius/PKGBUILD" + sed -i "s/^pkgver=.*/pkgver=$VERSION/" "$TARGET" + sed -i "s/^pkgrel=.*/pkgrel=1/" "$TARGET" + sed -i "s/^pkgdesc=.*/pkgdesc=\"Full local Termius alternative for Linux (GTK4) - built from stable source\"/" "$TARGET" + # Update the source hash (it's the only hash in this PKGBUILD) + sed -i "s/sha256sums=('.*')/sha256sums=('$HASH_SOURCE')/" "$TARGET" + + - name: Commit and Push PKGBUILDs run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add PKGBUILD + git add packages/ if [ -z "$(git status --porcelain)" ]; then echo "nothing to commit" else - git commit -m "chore: update PKGBUILD to ${{ needs.prepare.outputs.new_version }}" + git commit -m "chore: update PKGBUILDs to ${{ needs.prepare.outputs.new_version }}" git pull --rebase origin master git push origin master fi @@ -219,8 +244,8 @@ jobs: - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v4.1.3 with: - pkgname: rustmius-bin - pkgbuild: ./PKGBUILD + pkgname: ${{ matrix.package }} + pkgbuild: ./packages/${{ matrix.package }}/PKGBUILD commit_username: ${{ secrets.AUR_USERNAME }} commit_email: ${{ secrets.AUR_EMAIL }} ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} diff --git a/PKGBUILD b/packages/rustmius-bin/PKGBUILD similarity index 86% rename from PKGBUILD rename to packages/rustmius-bin/PKGBUILD index ececd35..67fc571 100644 --- a/PKGBUILD +++ b/packages/rustmius-bin/PKGBUILD @@ -2,7 +2,7 @@ pkgname=rustmius-bin _pkgname=rustmius pkgver=2.4.1 pkgrel=1 -pkgdesc="Full local Termius alternative for Linux (GTK4)" +pkgdesc="Full local Termius alternative for Linux (GTK4) - binary release" arch=('x86_64') url="https://github.com/Cleboost/Rustmius" license=('MIT') @@ -11,8 +11,8 @@ provides=("$_pkgname") conflicts=("$_pkgname") source=( - "$_pkgname.desktop::https://raw.githubusercontent.com/Cleboost/Rustmius/refs/heads/master/rustmius.desktop" - "$_pkgname.png::https://raw.githubusercontent.com/Cleboost/Rustmius/refs/heads/master/rustmius.png" + "$_pkgname.desktop::https://raw.githubusercontent.com/Cleboost/Rustmius/refs/heads/master/packages/rustmius.desktop" + "$_pkgname.png::https://raw.githubusercontent.com/Cleboost/Rustmius/refs/heads/master/packages/rustmius.png" "LICENSE::https://raw.githubusercontent.com/Cleboost/Rustmius/refs/heads/master/LICENSE" "$_pkgname-$pkgver-x86_64::$url/releases/download/v$pkgver/$_pkgname-x86_64" ) diff --git a/packages/rustmius-git/PKGBUILD b/packages/rustmius-git/PKGBUILD new file mode 100644 index 0000000..9d90363 --- /dev/null +++ b/packages/rustmius-git/PKGBUILD @@ -0,0 +1,32 @@ +pkgname=rustmius-git +_pkgname=rustmius +pkgver=r147.3691240 +pkgrel=1 +pkgdesc="Full local Termius alternative for Linux (GTK4) - latest development version (git)" +arch=('x86_64') +url="https://github.com/Cleboost/Rustmius" +license=('MIT') +depends=('gtk4' 'vte4') +makedepends=('cargo' 'git') +provides=("$_pkgname") +conflicts=("$_pkgname") +source=("git+$url.git") +sha256sums=('SKIP') + +pkgver() { + cd "$_pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "$_pkgname" + cargo build --release --locked +} + +package() { + cd "$_pkgname" + install -Dm755 "target/release/$_pkgname" "$pkgdir/usr/bin/$_pkgname" + install -Dm644 "packages/rustmius.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop" + install -Dm644 "packages/rustmius.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/$_pkgname.png" + install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$_pkgname/LICENSE" +} diff --git a/rustmius.desktop b/packages/rustmius.desktop similarity index 100% rename from rustmius.desktop rename to packages/rustmius.desktop diff --git a/rustmius.png b/packages/rustmius.png similarity index 100% rename from rustmius.png rename to packages/rustmius.png diff --git a/packages/rustmius/PKGBUILD b/packages/rustmius/PKGBUILD new file mode 100644 index 0000000..6b39324 --- /dev/null +++ b/packages/rustmius/PKGBUILD @@ -0,0 +1,24 @@ +pkgname=rustmius +pkgver=2.4.1 +pkgrel=1 +pkgdesc="Full local Termius alternative for Linux (GTK4) - built from stable source" +arch=('x86_64') +url="https://github.com/Cleboost/Rustmius" +license=('MIT') +depends=('gtk4' 'vte4') +makedepends=('cargo') +source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") +sha256sums=('767123982e56218d363d508922855f44208a098953181829623e100803328532') + +build() { + cd "$pkgname-$pkgver" + cargo build --release --locked +} + +package() { + cd "$pkgname-$pkgver" + install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" + install -Dm644 "packages/rustmius.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" + install -Dm644 "packages/rustmius.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/$pkgname.png" + install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +}