name: Publish to AUR
on:
push:
tags: ["v*.*.*"]
workflow_dispatch:
inputs:
tag:
description: "Tag to publish (e.g. v0.1.3)"
required: true
type: string
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out source (main)
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Extract version from tag
id: version
run: |
tag="${{ inputs.tag || github.ref_name }}"
pkgver="${tag#v}"
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
echo "pkgver=${pkgver}" >> "$GITHUB_OUTPUT"
- name: Compute source tarball sha256
id: sha
run: |
curl -fsSL \
"https://github.com/${{ github.repository }}/archive/refs/tags/${{ steps.version.outputs.tag }}.tar.gz" \
-o src.tar.gz
sum="$(sha256sum src.tar.gz | awk '{print $1}')"
echo "sha256=${sum}" >> "$GITHUB_OUTPUT"
- name: Patch PKGBUILD
run: |
sed -i "s|^pkgver=.*|pkgver=${{ steps.version.outputs.pkgver }}|" packaging/aur/PKGBUILD
sed -i "s|^pkgrel=.*|pkgrel=1|" packaging/aur/PKGBUILD
sed -i "s|^sha256sums=.*|sha256sums=('${{ steps.sha.outputs.sha256 }}')|" packaging/aur/PKGBUILD
echo "--- patched PKGBUILD ---"
cat packaging/aur/PKGBUILD
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.3
with:
pkgname: wdotool
pkgbuild: packaging/aur/PKGBUILD
commit_username: Matthew Cushing
commit_email: hgxtymphwn@privaterelay.appleid.com
ssh_private_key: ${{ secrets.AUR_SSH_KEY }}
commit_message: "Update to ${{ steps.version.outputs.pkgver }}"
ssh_keyscan_types: rsa,ecdsa,ed25519
- name: Sync updated PKGBUILD back to main
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "AUR: bump PKGBUILD to ${{ steps.version.outputs.pkgver }}"
file_pattern: packaging/aur/PKGBUILD
commit_user_name: Matthew Cushing
commit_user_email: hgxtymphwn@privaterelay.appleid.com
branch: main