From 9b0587b951a1ce50ab6d6ced0cb6abe257320149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C3=ABl=20Gareau?= Date: Fri, 28 Feb 2025 03:58:12 -0500 Subject: [PATCH] build(goreleaser): generate/publish AUR package (#32666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** 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?** - I ran `goreleaser release --snapshot --clean`: no errors / warnings - I ran `namcap -i PKGBUILD` on the newly generated file: no errors. **๐Ÿ“ƒ Notes:** 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._ --- .goreleaser.yaml | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index df5df668b2d..e9e486d68dc 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 " - 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 " + 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"