build(goreleaser): generate/publish AUR package (#32666)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
This PR modifies the `.goreleaser.yaml` file such that a PKGBUILD file
for AUR deployment of clustertool is automatically generated and
published. I followed the [AUR GoReleaser
Documentation](https://goreleaser.com/customization/aur/).

The `version_template` key is unsupported in modern versions of
goreleaser, so I also replaced that key by `name_template`.

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code
- [ ] 📜 Documentation Changes

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->
- I ran `goreleaser release --snapshot --clean`: no errors / warnings
- I ran `namcap -i PKGBUILD` on the newly generated file: no errors.

**📃 Notes:**
<!-- Please enter any other relevant information here -->
Unfortunately, the [`metadata`
section](https://goreleaser.com/customization/metadata/) of the
`.goreleaser.yaml` file can only be used when using the pro version, so
I had to duplicate some variables (maintainer, homepage, description,
license) between the `aurs` and the `nfpms` sections.

The previous description was a bit too generic for the AUR, so I changed
it to make the package more easily understood.

**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made changes to the documentation
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning
- [ ] I made sure the title starts with `feat(chart-name):`,
`fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or
`fix(docs):`

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Jaël Gareau
2025-02-28 03:58:12 -05:00
committed by GitHub
parent 965b005153
commit 9b0587b951
+25 -11
View File
@@ -22,7 +22,7 @@ archives:
checksum:
name_template: "checksums.txt"
snapshot:
version_template: "{{ incpatch .Version }}-next"
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
@@ -39,6 +39,8 @@ release:
github:
owner: truecharts
name: public
extra_files:
- glob: "clustertool/clustertool.LICENSE"
draft: false
make_latest: false
mode: append
@@ -67,14 +69,26 @@ before:
nfpms:
- package_name: clustertool
vendor: TrueCharts
homepage: https://truecharts.org
maintainer: "TrueCharts <info@truecharts.org>"
description: "ClusterTool CLI for AMD64 architecture."
license: BSL
formats:
- apk
- deb
- rpm
- termux.deb
- archlinux
homepage: "https://truecharts.org"
description: "Tool to help bootstrap a Kubernetes cluster"
license: "BUSL-1.1"
vendor: TrueCharts
formats: [apk, deb, rpm, termux.deb, archlinux]
aurs:
- name: "clustertool-bin"
maintainers:
- "TrueCharts <info@truecharts.org>"
homepage: "https://truecharts.org"
description: "Tool to help bootstrap a Kubernetes cluster"
license: "BUSL-1.1"
git_url: "ssh://aur@aur.archlinux.org/clustertool-bin.git"
skip_upload: auto
package: |
# Install binary
bsdtar -xvf clustertool_${pkgver}_linux_${CARCH}.tar.gz -C "${pkgdir}"
install -Dm755 "${pkgdir}/clustertool" "${pkgdir}/usr/bin/clustertool"
# Install license
install -Dm644 "${pkgdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"