Skip to content

Commit ab90f74

Browse files
hrzlgnmopencode
andauthored
feat: add aur-setup composite chaining the AUR packaging steps (#236)
Co-authored-by: opencode <noreply@opencode.ai>
1 parent dc057d6 commit ab90f74

2 files changed

Lines changed: 147 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 2026 hrzlgnm
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Setup AUR packaging
5+
description: Fix checkout ownership, install the AUR SSH key, clone the AUR repo, and verify the version
6+
7+
# Consumers pin this action directly, e.g.
8+
# uses: hrzlgnm/actions/.github/actions/aur-setup@<sha> # v2.12.0
9+
#
10+
# Runs all steps in the caller's job (same container and filesystem), so the
11+
# checkout ownership, ~/.ssh keys, and ~/aur clone are visible to later steps.
12+
# Sibling scripts are addressed relative to this action's directory; no
13+
# version pins between actions in this repo, they always move atomically.
14+
15+
inputs:
16+
package-name:
17+
description: AUR package name, e.g. mdns-browser or mdns-browser-bin
18+
required: true
19+
release-version:
20+
description: Release version, e.g. 1.13.0
21+
required: true
22+
deploy-key:
23+
description: SSH private key for the aur.archlinux.org service user
24+
required: true
25+
26+
runs:
27+
using: composite
28+
steps:
29+
- shell: bash
30+
env:
31+
ACTION_DIR: ${{ github.action_path }}
32+
run: '"$ACTION_DIR/../aur-fix-ownership/fix-ownership.sh"'
33+
34+
- uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
35+
env:
36+
ACTION_DIR: ${{ github.action_path }}
37+
AUR_DEPLOY_KEY: ${{ inputs.deploy-key }}
38+
with:
39+
timeout_minutes: 5
40+
max_attempts: 5
41+
retry_wait_seconds: 10
42+
warning_on_retry: true
43+
# su without --login keeps the step env and only resets
44+
# HOME/SHELL/USER/LOGNAME, so the script reads inputs from env.
45+
command: su runner -c '"$ACTION_DIR/../aur-setup-ssh/setup-aur-ssh.sh"'
46+
47+
- uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
48+
env:
49+
ACTION_DIR: ${{ github.action_path }}
50+
PACKAGE_NAME: ${{ inputs.package-name }}
51+
with:
52+
timeout_minutes: 5
53+
max_attempts: 5
54+
retry_wait_seconds: 10
55+
warning_on_retry: true
56+
# su without --login keeps the step env and only resets
57+
# HOME/SHELL/USER/LOGNAME, so the script reads inputs from env.
58+
command: su runner -c '"$ACTION_DIR/../aur-clone-repo/clone-aur-repo.sh"'
59+
60+
- shell: bash
61+
env:
62+
ACTION_DIR: ${{ github.action_path }}
63+
RELEASE_VERSION: ${{ inputs.release-version }}
64+
# su without --login keeps the step env and only resets
65+
# HOME/SHELL/USER/LOGNAME, so the script reads inputs from env.
66+
run: su runner -c '"$ACTION_DIR/../aur-check-version/check-aur-version.sh"'

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,84 @@ jobs:
136136
| `warning_on_retry` | no | `'true'` |
137137
| `shell` | no | `'bash'` |
138138

139+
## AUR packaging
140+
141+
Composite actions for Arch Linux AUR publishers running in an Arch
142+
builder container as root with a `runner` user. `aur-setup` chains the
143+
full in-job setup in one pinned step; the four granular actions below
144+
are available separately for custom flows.
145+
146+
### Quick Start
147+
148+
```yml
149+
- name: Setup AUR packaging
150+
if: github.event.release.tag_name
151+
uses: hrzlgnm/actions/.github/actions/aur-setup@v2.12.0
152+
with:
153+
package-name: ${{ matrix.package.name }}
154+
release-version: ${{ needs.release-info.outputs.version }}
155+
deploy-key: ${{ secrets.AUR_DEPLOY_KEY }}
156+
```
157+
158+
| Input | Required | Default |
159+
| --- | --- | --- |
160+
| `package-name` | yes | — |
161+
| `release-version` | yes | — |
162+
| `deploy-key` | yes | — |
163+
164+
Granular actions (pin like `hrzlgnm/actions/.github/actions/aur-setup-ssh@v2.11.0`):
165+
166+
### Fix AUR checkout ownership
167+
168+
Chowns the checkout to `runner` (AUR builder containers run as root).
169+
No inputs.
170+
171+
```yml
172+
- uses: hrzlgnm/actions/.github/actions/aur-fix-ownership@v2.11.0
173+
```
174+
175+
### Setup AUR SSH deployment key
176+
177+
Installs the deploy key and pins the `aur.archlinux.org` host keys to
178+
the Arch-published fingerprints (verified, retrying).
179+
180+
```yml
181+
- uses: hrzlgnm/actions/.github/actions/aur-setup-ssh@v2.11.0
182+
with:
183+
deploy-key: ${{ secrets.AUR_DEPLOY_KEY }}
184+
```
185+
186+
| Input | Required | Default |
187+
| --- | --- | --- |
188+
| `deploy-key` | yes | — |
189+
190+
### Clone AUR repo
191+
192+
Clones the AUR package repository to `~/aur`, discarding any previous
193+
checkout (retrying).
194+
195+
```yml
196+
- uses: hrzlgnm/actions/.github/actions/aur-clone-repo@v2.11.0
197+
with:
198+
package-name: ${{ matrix.package.name }}
199+
```
200+
201+
| Input | Required | Default |
202+
| --- | --- | --- |
203+
| `package-name` | yes | — |
204+
205+
### Check AUR version
206+
207+
Fails unless the release version is strictly higher than the `pkgver`
208+
recorded in the `~/aur` checkout.
209+
210+
```yml
211+
- uses: hrzlgnm/actions/.github/actions/aur-check-version@v2.11.0
212+
with:
213+
release-version: ${{ needs.release-info.outputs.version }}
214+
```
215+
216+
| Input | Required | Default |
217+
| --- | --- | --- |
218+
| `release-version` | yes | — |
219+

0 commit comments

Comments
 (0)