BlueGit

timfa posprint

Files

posprint / docs / AUR.md

AUR.md

AUR.md 3.2 KiB Download Raw

AUR publishing

How posprint is published to the Arch User Repository (AUR) from GitLab tags.

Chosen approach

This repository keeps two Arch package definitions:

  • packaging/arch/PKGBUILD: local builds and GitLab artifact builds (.pkg.tar.zst)
  • packaging/aur/PKGBUILD: AUR source package, built by the AUR user from the GitLab tag tarball

The AUR package is not -bin. It downloads:

https://gitlab.com/Timfa/posprint/-/archive/<version>/posprint-<version>.tar.gz

That keeps the AUR package simple, reproducible, and aligned with upstream tags.

Files in this repo

PathPurpose
packaging/aur/PKGBUILDAUR package template
packaging/aur/.SRCINFOInitial generated metadata
scripts/publish-aur.shClone AUR repo, update PKGBUILD/.SRCINFO, commit, push
.gitlab-ci.ymlRuns AUR publish on tags

Release flow

When a Git tag is pushed:

1. GitLab builds the normal release artifacts. 2. GitLab creates the upstream release. 3. GitLab runs scripts/publish-aur.sh "$CI_COMMIT_TAG". 4. The script:

  • downloads the tagged source tarball
  • computes its SHA-256
  • clones the AUR repo
  • updates pkgver, pkgrel, and sha256sums
  • regenerates .SRCINFO
  • commits and pushes to AUR master

GitLab CI secrets

Create these CI/CD variables in GitLab:

VariableRequiredNotes
AUR_SSH_PRIVATE_KEYyesPrivate SSH key for your AUR account; use masked + protected
AUR_GIT_AUTHOR_NAMErecommendedExample: Tim Falken or posprint release bot
AUR_GIT_AUTHOR_EMAILrecommendedExample: you@example.com
AUR_PKGBASEoptionalDefaults to posprint; only needed if the AUR repo name differs

Recommended GitLab settings:

  • mark the variables as Protected
  • mark AUR_SSH_PRIVATE_KEY as Masked
  • only allow the release/tag pipeline on protected tags

How to create the AUR repository

If you have an AUR account but no package yet:

1. Make sure your SSH public key is added to your AUR account profile. 2. On an Arch machine (or any machine with git + makepkg), create a working directory:

mkdir ~/posprint-aur
cd ~/posprint-aur
git init
git remote add origin ssh://aur@aur.archlinux.org/posprint.git

3. Copy in the initial metadata from this repo:

cp /path/to/posprint/packaging/aur/PKGBUILD .
cp /path/to/posprint/packaging/aur/.SRCINFO .

4. Commit and push:

git checkout -b master
git add PKGBUILD .SRCINFO
git commit -m "initial import"
git push origin master

After the first push, the AUR package page exists and later tag pipelines can update it.

Bootstrapping manually

Before enabling CI automation, test one update locally:

cd /path/to/posprint
./scripts/publish-aur.sh 0.4.0

Requirements on that machine:

  • git
  • curl
  • sha256sum
  • makepkg
  • SSH access to aur@aur.archlinux.org

Notes

  • pkgrel resets to 1 for every new upstream release.
  • If you need an AUR-only packaging fix without a new upstream release, bump pkgrel in the AUR repo manually.
  • .SRCINFO must always be committed together with PKGBUILD.
  • The AUR only accepts pushes to the master branch.
Source
1# AUR publishing
2
3How `posprint` is published to the Arch User Repository (AUR) from GitLab tags.
4
5## Chosen approach
6
7This repository keeps **two Arch package definitions**:
8
9- `packaging/arch/PKGBUILD`: local builds and GitLab artifact builds (`.pkg.tar.zst`)
10- `packaging/aur/PKGBUILD`: AUR source package, built by the AUR user from the GitLab tag tarball
11
12The AUR package is **not** `-bin`. It downloads:
13
14```text
15https://gitlab.com/Timfa/posprint/-/archive/<version>/posprint-<version>.tar.gz
16```
17
18That keeps the AUR package simple, reproducible, and aligned with upstream tags.
19
20## Files in this repo
21
22| Path | Purpose |
23|------|---------|
24| `packaging/aur/PKGBUILD` | AUR package template |
25| `packaging/aur/.SRCINFO` | Initial generated metadata |
26| `scripts/publish-aur.sh` | Clone AUR repo, update `PKGBUILD`/`.SRCINFO`, commit, push |
27| `.gitlab-ci.yml` | Runs AUR publish on tags |
28
29## Release flow
30
31When a Git tag is pushed:
32
331. GitLab builds the normal release artifacts.
342. GitLab creates the upstream release.
353. GitLab runs `scripts/publish-aur.sh "$CI_COMMIT_TAG"`.
364. The script:
37 - downloads the tagged source tarball
38 - computes its SHA-256
39 - clones the AUR repo
40 - updates `pkgver`, `pkgrel`, and `sha256sums`
41 - regenerates `.SRCINFO`
42 - commits and pushes to AUR `master`
43
44## GitLab CI secrets
45
46Create these **CI/CD variables** in GitLab:
47
48| Variable | Required | Notes |
49|----------|----------|-------|
50| `AUR_SSH_PRIVATE_KEY` | yes | Private SSH key for your AUR account; use **masked** + **protected** |
51| `AUR_GIT_AUTHOR_NAME` | recommended | Example: `Tim Falken` or `posprint release bot` |
52| `AUR_GIT_AUTHOR_EMAIL` | recommended | Example: `you@example.com` |
53| `AUR_PKGBASE` | optional | Defaults to `posprint`; only needed if the AUR repo name differs |
54
55Recommended GitLab settings:
56
57- mark the variables as **Protected**
58- mark `AUR_SSH_PRIVATE_KEY` as **Masked**
59- only allow the release/tag pipeline on protected tags
60
61## How to create the AUR repository
62
63If you have an AUR account but no package yet:
64
651. Make sure your **SSH public key** is added to your AUR account profile.
662. On an Arch machine (or any machine with `git` + `makepkg`), create a working directory:
67
68```bash
69mkdir ~/posprint-aur
70cd ~/posprint-aur
71git init
72git remote add origin ssh://aur@aur.archlinux.org/posprint.git
73```
74
753. Copy in the initial metadata from this repo:
76
77```bash
78cp /path/to/posprint/packaging/aur/PKGBUILD .
79cp /path/to/posprint/packaging/aur/.SRCINFO .
80```
81
824. Commit and push:
83
84```bash
85git checkout -b master
86git add PKGBUILD .SRCINFO
87git commit -m "initial import"
88git push origin master
89```
90
91After the first push, the AUR package page exists and later tag pipelines can update it.
92
93## Bootstrapping manually
94
95Before enabling CI automation, test one update locally:
96
97```bash
98cd /path/to/posprint
99./scripts/publish-aur.sh 0.4.0
100```
101
102Requirements on that machine:
103
104- `git`
105- `curl`
106- `sha256sum`
107- `makepkg`
108- SSH access to `aur@aur.archlinux.org`
109
110## Notes
111
112- `pkgrel` resets to `1` for every new upstream release.
113- If you need an AUR-only packaging fix without a new upstream release, bump `pkgrel` in the AUR repo manually.
114- `.SRCINFO` must always be committed together with `PKGBUILD`.
115- The AUR only accepts pushes to the `master` branch.