---
name: AUR Publish
on:
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g., 2.5.0)"
required: true
type: string
pkgrel:
description: "Package release (bump for packaging-only fixes; 1 for a new version)"
required: false
default: "1"
type: string
workflow_run:
workflows: ["Release"]
types: [completed]
jobs:
publish-aur:
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch || github.event.repository.default_branch }}
- name: Get Version
id: get_version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
RAW_VERSION="${{ github.event.inputs.version }}"
else
RAW_VERSION="${{ github.event.workflow_run.head_branch }}"
fi
VERSION="${RAW_VERSION#v}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Resolved version: $VERSION"
- name: Update PKGBUILD version
run: |
PKGREL="${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pkgrel || '1' }}"
sed -i "s/^pkgver=.*/pkgver=${{ env.VERSION }}/" aur/PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=${PKGREL}/" aur/PKGBUILD
cat aur/PKGBUILD
- name: Publish to AUR
uses: KSXGitHub/github-actions-deploy-aur@v4.1.3
with:
pkgname: jwt-hack
pkgbuild: aur/PKGBUILD
commit_username: hahwul
commit_email: hahwul@gmail.com
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}