Skip to content

Commit f80e629

Browse files
committed
Improve AUR workflow to publish only on PKGBUILD changes
The workflow now checks if PKGBUILD or PKGBUILD-BIN files have changed before publishing the corresponding AUR packages. This prevents unnecessary publishes and streamlines the manual AUR publish process. Also, the workflow_dispatch input for tag selection was removed.
1 parent 9ab19a4 commit f80e629

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

.github/workflows/aur.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Manual AUR Publish
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: "Tag to publish (e.g., v1.0.0)"
8-
required: true
9-
default: "v0.1.0"
105

116
env:
127
CARGO_TERM_COLOR: always
@@ -24,8 +19,29 @@ jobs:
2419
steps:
2520
- name: Checkout code
2621
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 2
24+
25+
- name: Check if PKGBUILD changed
26+
id: check-rustmius
27+
run: |
28+
if git diff --name-only HEAD~1 HEAD | grep -q "^PKGBUILD$"; then
29+
echo "changed=true" >> $GITHUB_OUTPUT
30+
else
31+
echo "changed=false" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Check if PKGBUILD-BIN changed
35+
id: check-rustmius-bin
36+
run: |
37+
if git diff --name-only HEAD~1 HEAD | grep -q "^PKGBUILD-BIN$"; then
38+
echo "changed=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "changed=false" >> $GITHUB_OUTPUT
41+
fi
2742
28-
- name: Publish AUR package
43+
- name: Publish AUR package (rustmius)
44+
if: steps.check-rustmius.outputs.changed == 'true'
2945
uses: KSXGitHub/[email protected]
3046
with:
3147
pkgname: rustmius
@@ -36,7 +52,8 @@ jobs:
3652
commit_message: Update AUR package
3753
ssh_keyscan_types: rsa,ecdsa,ed25519
3854

39-
- name: Publish AUR package
55+
- name: Publish AUR package (rustmius-bin)
56+
if: steps.check-rustmius-bin.outputs.changed == 'true'
4057
uses: KSXGitHub/[email protected]
4158
with:
4259
pkgname: rustmius-bin

0 commit comments

Comments
 (0)