Skip to content

Commit 2341931

Browse files
committed
update goreleaser template
1 parent 4a63ee0 commit 2341931

1 file changed

Lines changed: 36 additions & 11 deletions

File tree

cmd/tpl/deployment.go

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,13 @@ ENTRYPOINT ["./{{ .Name }}ctl"]
122122
}
123123

124124
func GoReleaser() []byte {
125-
return []byte(`env:
126-
- IMAGE_TAG={{.Tag}}
127-
128-
125+
return []byte(`version: 2
129126
project_name: [% .Name %]ctl
130127
131128
builds:
132-
- ldflags: "-extldflags= -w -X '[% .Module %]/cmd.Version={{.Tag}}'"
133-
flags:
134-
- -mod=vendor
135-
env:
136-
- "CGO_ENABLED=0"
129+
- env:
130+
- CGO_ENABLED=0
131+
- IMAGE_TAG={{.Tag}}
137132
- "GO111MODULE=on"
138133
goos:
139134
- linux
@@ -142,8 +137,38 @@ builds:
142137
goarch:
143138
- amd64
144139
- arm64
145-
source:
146-
enabled: true
140+
ldflags: "-extldflags= -w -X 'github.com/SencilloDev/[% .Name %]/cmd.Version={{.Tag}}'"
141+
flags:
142+
- -mod=vendor
143+
144+
archives:
145+
- formats: [binary]
146+
name_template: >-
147+
{{ .ProjectName }}_
148+
{{- title .Os }}_
149+
{{- if eq .Arch "amd64" }}x86_64
150+
{{- else if eq .Arch "386" }}i386
151+
{{- else }}{{ .Arch }}{{ end }}
152+
{{- if .Arm }}v{{ .Arm }}{{ end }}
153+
# use zip for windows archives
154+
format_overrides:
155+
- goos: windows
156+
formats: [binary]
157+
158+
changelog:
159+
sort: asc
160+
filters:
161+
exclude:
162+
- "^docs:"
163+
- "^test:"
164+
165+
release:
166+
footer: >-
167+
168+
---
169+
170+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
171+
147172
`)
148173
}
149174

0 commit comments

Comments
 (0)