-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path.goreleaser.yml
More file actions
206 lines (195 loc) · 7.03 KB
/
.goreleaser.yml
File metadata and controls
206 lines (195 loc) · 7.03 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
---
version: 2
variables:
main: "."
binary_name: "jellysweep"
description: "Smart cleanup tool for Jellyfin media servers that automatically removes old, unwatched content"
github_url: "https://github.com/jon4hz/jellysweep"
maintainer: "jonah <me@jon4hz.io>"
license: "GPL-3.0-or-later"
homepage: "https://github.com/jon4hz/jellysweep"
ghcr_io_registry_owner: "jon4hz"
before:
hooks:
- go mod tidy
- rm -rf completions
- mkdir completions
- 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'
builds:
- id: default
env:
- CGO_ENABLED=0
main: "{{ .Var.main }}"
binary: "{{ .Var.binary_name }}"
ldflags:
- -s
- -w
- -X github.com/jon4hz/{{ .ProjectName }}/internal/version.Version={{ .Version }}
- -X github.com/jon4hz/{{ .ProjectName }}/internal/version.Commit={{ .Commit }}
- -X github.com/jon4hz/{{ .ProjectName }}/internal/version.Date={{ .Date }}
- -X github.com/jon4hz/{{ .ProjectName }}/internal/version.BuiltBy=goreleaser
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
- arm64
- id: windows
env:
- CGO_ENABLED=0
main: "{{ .Var.main }}"
binary: "{{ .Var.binary_name }}"
ldflags:
- -s
- -w
- -X github.com/jon4hz/{{ .ProjectName }}/version.Version={{ .Version }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.Commit={{ .Commit }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.Date={{ .Date }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.BuiltBy=goreleaser
flags:
- -trimpath
goos:
- windows
goarch:
- amd64
- id: macOS
env:
- CGO_ENABLED=1
main: "{{ .Var.main }}"
binary: "{{ .Var.binary_name }}"
ldflags:
- -s
- -w
- -X github.com/jon4hz/{{ .ProjectName }}/version.Version={{ .Version }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.Commit={{ .Commit }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.Date={{ .Date }}
- -X github.com/jon4hz/{{ .ProjectName }}/version.BuiltBy=goreleaser
flags:
- -trimpath
goos:
- darwin
ignore:
- goos: darwin
goarch: "386"
archives:
- id: default
name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}"
wrap_in_directory: true
ids:
- default
- macOS
files:
- LICENSE*
- README*
- CHANGELOG*
- completions/
- id: windows
name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}-{{ .Mips }}{{ end }}"
wrap_in_directory: true
ids:
- windows
format_overrides:
- goos: windows
formats: [zip]
files:
- LICENSE*
- README*
- CHANGELOG*
checksum:
name_template: "checksums.txt"
nfpms:
- file_name_template: "{{ .ProjectName }}-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:
- 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 }}
source:
enabled: true
snapshot:
version_template: "{{ incpatch .Version }}-devel"
changelog:
sort: asc
use: github
filters:
exclude:
- "^test:"
- "^chore"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: "💥 Breaking Changes"
regexp: "^.*[(\\w)]*!:+.*$"
order: 50
- title: "🚀 New Features"
regexp: "^.*feat[(\\w)]*:+.*$"
order: 100
- title: "🐛 Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 200
- title: "📦 Dependency updates"
regexp: "^.*\\(deps\\)*:+.*$"
order: 300
- title: "📚 Documentation updates"
regexp: "^.*docs[(\\w)]*:+.*$"
order: 400
- title: "🔧 Other work"
order: 9999
dockers:
- image_templates:
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-amd64"
goarch: amd64
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .Var.description }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.version=v{{ .Version }}
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=GPL-3.0-or-later
dockerfile: release.Dockerfile
use: buildx
- image_templates:
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-arm64"
goarch: arm64
build_flag_templates:
- --platform=linux/arm64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .Var.description }}
- --label=org.opencontainers.image.source={{ .GitURL }}
- --label=org.opencontainers.image.version=v{{ .Version }}
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=GPL-3.0-or-later
dockerfile: release.Dockerfile
use: buildx
docker_manifests:
- name_template: "{{ if not .IsNightly }}ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:latest{{ end }}"
image_templates:
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-arm64"
- name_template: "{{ if not .IsNightly }}ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}{{ end }}"
image_templates:
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-arm64"
- name_template: "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}"
image_templates:
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-amd64"
- "ghcr.io/{{ .Var.ghcr_io_registry_owner }}/{{ .ProjectName }}:v{{ .Version }}-arm64"