Skip to content

Commit 07a1f88

Browse files
authored
ci: publish AUR from sources (#895)
1 parent 72c70bb commit 07a1f88

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.goreleaser.yml

+44
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ archives:
9595
- completions/*
9696
- manpages/*
9797
98+
source:
99+
enabled: true
100+
name_template: '{{ .ProjectName }}_{{ .Version }}_source'
101+
98102
brews:
99103
- repository:
100104
owner: goreleaser
@@ -221,6 +225,46 @@ aurs:
221225
# man pages
222226
install -Dm644 "./manpages/nfpm.1.gz" "${pkgdir}/usr/share/man/man1/nfpm.1.gz"
223227
228+
aur_sources:
229+
- homepage: https://nfpm.goreleaser.com
230+
description: nFPM is a simple, 0-dependencies, deb, rpm and apk packager.
231+
maintainers:
232+
- "Fernandez Ludovic <lfernandez dot dev at gmail dot com>"
233+
- "Carlos Alexandro Becker <carlos at becker dot software>"
234+
license: MIT
235+
private_key: "{{ .Env.AUR_KEY }}"
236+
git_url: "ssh://[email protected]/nfpm.git"
237+
build: |-
238+
cd "${pkgname}-${pkgver}"
239+
240+
export CGO_CPPFLAGS="${CPPFLAGS}"
241+
export CGO_CFLAGS="${CFLAGS}"
242+
export CGO_CXXFLAGS="${CXXFLAGS}"
243+
export CGO_LDFLAGS="${LDFLAGS}"
244+
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
245+
go build -ldflags="-w -s -buildid='' -linkmode=external -X main.version=v${pkgver}" ./cmd/nfpm
246+
247+
ls -alF
248+
chmod +x "./${pkgname}"
249+
package: |-
250+
251+
cd "${pkgname}-${pkgver}"
252+
ls -alF
253+
254+
# Bin
255+
install -Dsm755 "./${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
256+
257+
# License
258+
install -Dm644 "./LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
259+
260+
# Completions
261+
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
262+
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
263+
mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
264+
./${pkgname} completion bash > "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
265+
./${pkgname} completion zsh > "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
266+
./${pkgname} completion fish > "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
267+
224268
furies:
225269
- account: goreleaser
226270

0 commit comments

Comments
 (0)