As an Arch Linux developer who maintains multiple AUR (Arch User Repository) packages, updating them used to involve a tedious, repetitive routine every time I released a new version:
**1. Push a new version tag to the main project repository: git tag v0.1.1 && git push origin v0.1.1
- Switch to the AUR mirror repository and manually update pkgver to 0.1.1 in the PKGBUILD.
- Run updpkgsums and makepkg --printsrcinfo > .SRCINFO to update checksums and metadata.
- Commit the changes and run git push to the AUR upstream.**
Honestly, this kind of mechanical workflow wears down your focus. More importantly, if you believe in a "code anywhere, on the move" philosophy—like merging a critical community patch from your phone while away from your desk—completing this convoluted manual process on a mobile device is practically impossible.
To eliminate this friction, I automated the entire setup. Now, I can cut a release tag directly from my phone, and a GitHub Action handles the heavy lifting in the background.
Here is the exact blueprint to set it up.
1. The GitHub Action Workflow
Create a file named .github/workflows/publish-aur.yml in your project's root directory.
name: Publish to AUR
on:
push:
tags:
- 'v*'
jobs:
publish-aur:
name: Publish to AUR
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update PKGBUILD version
run: |
sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.version }}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
- name: Publish AUR package
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with:
pkgname: lazycat-terminal
pkgbuild: ./PKGBUILD
updpkgsums: true
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to version ${{ steps.version.outputs.version }}"
ssh_keyscan_types: rsa,ecdsa,ed25519
2. Configure GitHub Repository Secrets
To grant the runner write access to your AUR repository, you need to store your credentials securely.
Navigate to your GitHub repository and go to Settings -> Secrets and variables -> Actions. Click New repository secret and add these three variables:
AUR_USERNAME: Your AUR username.
AUR_EMAIL: Your registered AUR email.
AUR_SSH_PRIVATE_KEY: Your AUR SSH private key.
🔒 Security Note:
To prevent your primary SSH key from being exposed to third-party runners, it is highly recommended to generate a dedicated SSH key pair exclusively for this GitHub Action. Add the public key directly to your AUR profile settings.
Generate it via: ssh-keygen -t ed25519 -C "your.email@gmail.com"
3.Testing
Once configured, simply running git tag version && git push origin version from your computer will automatically trigger the GitHub Action. Alternatively, you can cut a tag manually using the GitHub web interface on your mobile phone.
As soon as the GitHub Action finishes running, your AUR package is updated!
As someone who champions the "code anywhere, on the move" philosophy, being able to handle an AUR deployment from my phone while out for a walk is a game-changer.
What about you? What repetitive plumbing or packaging bottlenecks in your Linux workflow or open-source maintenance are you dying to automate away? Do you have any favorite scripts or tools that completely freed you from your desktop?
Let's talk about it in the comments below—let's keep our time and energy focused on core architecture and engineering logic instead! 🚀
Top comments (0)