-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.goreleaser.yml
129 lines (119 loc) · 4.36 KB
/
.goreleaser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
variables:
main: "."
binary_name: "awoolt"
description: "interactively browse vault/openbao in the terminal."
maintainer: "jonah <me@jon4hz.io>"
license: "MIT"
homepage: "https://github.com/jon4hz/awoolt"
aur_package: |-
# bin
install -Dm755 "./{{ .ProjectName }}" "${pkgdir}/usr/bin/{{ .ProjectName }}"
# license
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/{{ .ProjectName }}/LICENSE"
# completions
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
install -Dm644 "./completions/{{ .ProjectName }}.bash" "${pkgdir}/usr/share/bash-completion/completions/{{ .ProjectName }}"
install -Dm644 "./completions/{{ .ProjectName }}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_{{ .ProjectName }}"
install -Dm644 "./completions/{{ .ProjectName }}.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/{{ .ProjectName }}.fish"
# man pages
install -Dm644 "./manpages/{{ .ProjectName }}.1.gz" "${pkgdir}/usr/share/man/man1/{{ .ProjectName }}.1.gz"
# readme
mkdir -pv "${pkgdir}/usr/share/doc/{{ .ProjectName }}/"
install -Dm644 README* "${pkgdir}/usr/share/doc/{{ .ProjectName }}/"
before:
hooks:
- go mod tidy
- rm -rf completions
- mkdir completions
- rm -rf manpages
- mkdir manpages
- sh -c 'go run {{ with .Var.main }}{{ . }}{{ else }}.{{ end }} completion "bash" >./completions/{{ .ProjectName }}.bash'
- sh -c 'go run {{ with .Var.main }}{{ . }}{{ else }}.{{ end }} completion "zsh" >./completions/{{ .ProjectName }}.zsh'
- sh -c 'go run {{ with .Var.main }}{{ . }}{{ else }}.{{ end }} completion "fish" >./completions/{{ .ProjectName }}.fish'
- sh -c 'go run {{ with .Var.main }}{{ . }}{{ else }}.{{ end }} man | gzip -c >./manpages/{{ .ProjectName }}.1.gz'
builds:
- id: default
env:
- CGO_ENABLED=0
main: "{{ .Var.main }}"
binary: "{{ with .Var.binary_name }}{{ . }}{{ else }}{{ .ProjectName }}{{ end }}"
ldflags:
- -s
- -w
- -X github.com/jon4hz/{{ .Var.binary_name }}/version.Version={{ .Version }}
- -X github.com/jon4hz/{{ .Var.binary_name }}/version.Commit={{ .Commit }}
- -X github.com/jon4hz/{{ .Var.binary_name }}/version.Date={{ .Date }}
- -X github.com/jon4hz/{{ .Var.binary_name }}/version.BuiltBy=goreleaser
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
archives:
- id: default
name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}"
builds:
- default
files:
- LICENSE*
- README*
- manpages/*
- completions/*
checksum:
name_template: "checksums.txt"
nfpms:
- file_name_template: "{{ .Var.binary_name }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}"
vendor: jon4hz
homepage: "{{ .Var.homepage }}"
maintainer: "{{ .Var.maintainer }}"
description: "{{ .Var.description }}"
license: "{{ .Var.license }}"
formats:
- apk
- deb
- rpm
contents:
- src: ./completions/{{ .ProjectName }}.bash
dst: /etc/bash_completion.d/{{ .ProjectName }}
- src: ./completions/{{ .ProjectName }}.fish
dst: /usr/share/fish/vendor_completions.d/{{ .ProjectName }}.fish
- src: ./completions/{{ .ProjectName }}.zsh
dst: /usr/share/zsh/site-functions/_{{ .ProjectName }}
- src: ./manpages/{{ .ProjectName }}.1.gz
dst: /usr/share/man/man1/{{ .ProjectName }}.1.gz
aurs:
- name: "{{ .Var.binary_name }}-bin"
homepage: "{{ .Var.homepage }}"
description: "{{ .Var.description }}"
maintainers:
- "{{ .Var.maintainer }}"
license: "{{ .Var.license }}"
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://aur@aur.archlinux.org/{{ .Var.binary_name }}-bin.git"
package: "{{ .Var.aur_package }}"
source:
enabled: true
snapshot:
name_template: "{{ incpatch .Version }}-devel"
changelog:
sort: asc
use: github
filters:
exclude:
- "^docs:"
- "^test:"
groups:
- title: "New Features"
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 10
- title: Others
order: 999
furies:
- account: jon4hz