Skip to content

First Release

Choose a tag to compare

@Da4ndo Da4ndo released this 11 Mar 20:33
· 16 commits to master since this release
52af512

πŸš€ Rust AUR Release Deploy

A powerful GitHub Action for building Rust applications, creating GitHub releases, and preparing packages for the Arch User Repository (AUR) deployment.


✨ Features

  • πŸ¦€ 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

πŸš€ Usage

Basic Example

name: Release and Deploy

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: true
        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@v1
        with:
          pkg_name: your-package-name
          version: ${{ github.event.inputs.version }}  # If not provided, uses latest tag
          rel: ${{ github.event.inputs.rel || '1' }}
          build_linux: true
          build_windows: true
          linux_files: '["LICENSE", "config.toml"]'
          windows_files: '["LICENSE", "config.win.toml"]'
          release_files: '["README.md"]'
          pkgbuild: './PKGBUILD'
        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

πŸ’‘ Note: For more complex examples, check out the examples directory.

Release Handling

The action intelligently handles GitHub releases:

  1. If a version is provided:

    • If a release with that version tag exists, it will upload assets to it
    • If no release exists, it will create a new one
  2. If no version is provided:

    • Uses the latest git tag as the version
    • If no tags exist, the action will fail with a clear error message
    • Follows the same logic as above for existing/new releases

This means you can:

  • Create new releases with new versions
  • Add additional assets to existing releases
  • Use the latest tag automatically
    All without any additional configuration!

πŸ“‹ Inputs

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
pkg_name Name of your package Yes N/A
build_linux Whether to build for Linux No true
build_windows Whether to build for Windows No false
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'

πŸ“€ Outputs

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

πŸ” Environment Variables

Name Description
GITHUB_TOKEN GitHub token for creating releases

πŸ“š Documentation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

[Released]

1.0.0 - 2025-03-05

Added

  • Cross-platform build support for Linux and Windows
  • Platform-specific file packaging with linux_files and windows_files
  • Separate release files with release_files parameter
  • Automatic tar.gz archive creation for Linux builds
  • Automatic zip archive creation for Windows builds
  • SHA256 sum calculation for all archives
  • Intelligent release handling (automatically uses existing release or creates new one)
  • More flexible output paths with pkgbuild_output_path
  • Improved error handling for missing git tags
  • Enhanced emoji-based logging for better visibility
  • Initial release of the Rust AUR Release Deploy GitHub Action
  • Support for building Rust applications for multiple platforms
  • Support for creating GitHub releases with compiled binaries
  • Support for deploying packages to the Arch User Repository (AUR)
  • Support for using existing PKGBUILD files
  • Documentation and examples

Changed

  • Split AUR deployment into separate step using KSXGitHub/github-actions-deploy-aur@v4.1.1
  • Renamed aur parameter to prepare_aur to better reflect its purpose
  • Changed file packaging to use platform-specific archives
  • Improved error handling and logging with emojis
  • Made the action more modular and flexible
  • Simplified release handling logic (removed create_release parameter)
  • Updated documentation and examples for new features
  • Shortened parameter names for better usability:
    • additional_files β†’ files
    • deploy_to_aur β†’ aur
    • pkgbuild_path β†’ pkgbuild
  • Changed aur parameter to use boolean type instead of string
  • Modified files parameter to only accept JSON arrays

Removed

  • Direct AUR deployment (now handled by KSXGitHub/github-actions-deploy-aur)
  • aarch64 Linux build support (focusing on x86_64)
  • Combined file list in favor of platform-specific lists
  • create_release parameter (now handled automatically)

πŸ“„ License

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! ⭐