A powerful GitHub Action for building Rust applications, creating GitHub releases, and preparing packages for the Arch User Repository (AUR) deployment.
Features β’ Usage β’ Inputs β’ Documentation β’ License
- π¦ Build and package Rust applications with ease
- π― Cross-platform support for Linux and Windows builds
- π¦ Smart release handling - automatically uses existing releases or creates new ones
- ποΈ Prepare packages for AUR deployment automatically
- π Modular workflow design for flexible deployment options
- π οΈ Customizable build and packaging options for each platform
- π± Git package support - easily deploy -git packages to AUR with specific commit pinning
- π§ Flexible versioning with automatic tag detection
name: Basic Usage Example
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (e.g. v1.0.0)'
required: false
rel:
description: 'Release number (e.g. 1)'
required: false
default: '1'
jobs:
release_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and Prepare Release
id: release
uses: Da4ndo/rust-aur-release-deploy@v2
with:
package_name: your-package-name
version: ${{ github.event.inputs.version }}
rel: ${{ github.event.inputs.rel || '1' }}
platform: linux
pkgbuild: './PKGBUILD'
auto_release: true
generate_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with:
pkgname: your-package-name
pkgbuild: ${{ steps.release.outputs.pkgbuild_path }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to version ${{ steps.release.outputs.version }}"
ssh_keyscan_types: rsa,ecdsa,ed25519
For -git packages that track the main branch:
name: Git Package Release
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
release_and_deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version info
id: version
shell: bash
run: |
VERSION=$(grep -m 1 '^version = ' Cargo.toml | cut -d '"' -f 2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "commit_count=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT
- name: Build and Prepare Release
id: release
uses: Da4ndo/rust-aur-release-deploy@v2
with:
package_name: your-package-name-git
# The commit hash part is extracted and used to pin the specific commit in the source URL
version: ${{ steps.version.outputs.version }}.r${{ steps.version.outputs.commit_count }}.g${{ steps.version.outputs.commit_short }}
rel: 1
platform: linux
linux_files: '["LICENSE", "README.md"]'
pkgbuild: './PKGBUILD-git'
is_git_package: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
with:
pkgname: your-package-name-git
pkgbuild: ${{ steps.release.outputs.pkgbuild_path }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to ${{ steps.version.outputs.version }}.r${{ steps.version.outputs.commit_count }}.g${{ steps.version.outputs.commit_short }}"
ssh_keyscan_types: rsa,ecdsa,ed25519
π‘ Note: For more examples, check out the examples directory.
The action intelligently handles GitHub releases:
-
When triggered by a release event:
- Uses the release version and assets
- Updates or creates AUR package accordingly
-
When triggered by workflow_dispatch:
- Uses the provided version if specified
- Creates or updates the release as needed
- Deploys to AUR with the specified version
-
For git packages:
- Uses version from Cargo.toml with git metadata
- Skips release creation
- Updates AUR -git package with latest commit
This flexibility allows you to:
- Automate releases with GitHub's release system
- Manually trigger releases with custom versions
- Maintain -git packages that track your main branch All with proper versioning and minimal configuration!
Name | Description | Required | Default |
---|---|---|---|
version |
Version to deploy (e.g., v1.0.0). If not provided, uses the latest release tag. | No | Latest release tag |
package_name |
Name of your package | Yes | N/A |
platform |
Platforms to build for (linux, windows, or both) | No | 'linux' |
linux_files |
List of additional files to include in the Linux tar.gz archive (JSON array) | No | '[]' |
windows_files |
List of additional files to include in the Windows release (JSON array) | No | '[]' |
release_files |
List of additional files to include in the GitHub release but not in platform archives (JSON array) | No | '[]' |
rel |
Release number for AUR package | No | '1' |
prepare_aur |
Whether to prepare PKGBUILD for AUR deployment | No | true |
pkgbuild |
Path to the PKGBUILD file to use for AUR deployment | No | '' |
pkgbuild_output_path |
Path where the prepared PKGBUILD file should be saved | No | './prepared_pkgbuild/PKGBUILD' |
is_git_package |
Whether this is a -git deployment | No | false |
auto_release |
Whether to automatically create/update GitHub release | No | true |
generate_notes |
Whether to generate release notes automatically | No | true |
Name | Description |
---|---|
version |
The version that was deployed |
linux_archive |
Path to the Linux tar.gz archive |
linux_sha256 |
SHA256 sum of the Linux archive |
windows_archive |
Path to the Windows zip archive |
windows_sha256 |
SHA256 sum of the Windows archive |
pkgbuild_path |
The path to the prepared PKGBUILD file |
Name | Description |
---|---|
GITHUB_TOKEN |
GitHub token for creating releases |
- PKGBUILD Guide - Learn how to create and customize your PKGBUILD file
- Changelog - View the version history and changes
- Contributing Guide - Learn how to contribute to this project
-
Create an SSH key pair for AUR authentication:
ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/aur
-
Add the public key to your AUR account at https://aur.archlinux.org/account/
-
Add the following secrets to your GitHub repository:
AUR_SSH_PRIVATE_KEY
: Your AUR SSH private keyAUR_USERNAME
: Your AUR usernameAUR_EMAIL
: Your AUR email
-
Create a PKGBUILD file in your repository (see PKGBUILD Guide)
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Da4ndo
β Star this repository if you find it useful! β