π Update & publish AUR package #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Update & publish AUR package | |
on: | |
workflow_call: | |
inputs: | |
packages: | |
description: Name of the package | |
required: true | |
type: string | |
secrets: | |
AUR_SSH_PRIVATE_KEY: | |
description: Private key for the AUR account | |
required: true | |
KNOWN_HOSTS: | |
description: Known hosts file | |
required: true | |
AUR_EMAIL: | |
description: Email address for the AUR account | |
required: true | |
AUR_USERNAME: | |
description: Username for the AUR account | |
required: true | |
workflow_dispatch: | |
inputs: | |
packages: | |
description: Name of the package | |
required: true | |
type: choice | |
options: | |
- "['asus-numberpad-driver-git']" | |
- "['dwall-git']" | |
- "['kawaiki-grub2-themes-git']" | |
- "['mkinitcpio-colors-git']" | |
- "['oh-my-posh-bin']" | |
- "['openasar-git']" | |
- "['sqruff-bin']" | |
- "['termdbms-git']" | |
- "['up-metro-for-steam-skin']" | |
force: | |
description: Force package push | |
type: boolean | |
required: false | |
jobs: | |
aur: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
pkgname: ${{ fromJson(format('{0}{1}', github.event.inputs.packages, inputs.packages)) }} | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: π Update package | |
uses: kamack38/pkgbuild-update@main | |
id: update | |
with: | |
path: packages/${{ matrix.pkgname }} | |
updpkgsums: true | |
aur_pkgname: ${{ matrix.pkgname }} | |
aur_commit_username: ${{ secrets.AUR_USERNAME }} | |
aur_commit_email: ${{ secrets.AUR_EMAIL }} | |
aur_ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
- name: π Fetch newest repo version | |
run: git pull | |
- name: π€ Check if package updated | |
if: ${{ github.event.inputs.packages != true }} | |
run: | | |
if [[ $(git status --porcelain) ]]; then echo "UPDATED=true" >> $GITHUB_ENV; else echo "UPDATED=false" >> $GITHUB_ENV; fi | |
- name: π Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'feat: πΌ Update ${{ matrix.pkgname }} from ${{ steps.update.outputs.old_pkgver }} to ${{ steps.update.outputs.new_pkgver }}' | |
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |