-
Notifications
You must be signed in to change notification settings - Fork 1
/
.goreleaser.yaml
105 lines (105 loc) · 3.52 KB
/
.goreleaser.yaml
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
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
- go mod tidy
- go test -v ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
ldflags:
- -X main.Version={{.Version}} -X main.Commit={{.Commit}} -X main.BuildDate={{ .CommitDate }}
main: ./cmd/main.go
archives:
- name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else if eq .Arch "darwin" }}Darwin
{{- else if eq .Arch "linux" }}Linux
{{- else if eq .Arch "windows" }}Windows
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
# build latest and specific tag version images
# https://goreleaser.com/cookbooks/multi-platform-docker-images/#other-things-to-pay-attention-to
- image_templates:
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}"
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}-amd64"
- "ghcr.io/linode-obs/{{.ProjectName}}:latest" # keep latest as linux/amd64
use: buildx
goos: linux
goarch: amd64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/linode-obs/go_project_template"
- "--label=org.opencontainers.image.description='go_project_template description TODO'"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/amd64"
dockerfile: "Dockerfile"
- image_templates:
- "ghcr.io/linode-obs/{{.ProjectName}}:{{ .Tag }}-linux-arm64"
use: buildx
goos: linux
goarch: arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/linode-obs/go_project_template"
- "--label=org.opencontainers.image.description='go_project_template description TODO'"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/arm64"
dockerfile: "Dockerfile"
nfpms:
- id: default
formats:
- deb
- rpm
package_name: "go_project_template"
section: "default"
priority: "extra"
replaces: []
dependencies: []
recommends: []
suggests: []
conflicts: []
maintainer: "Will Bollock <[email protected]>"
description: |
go_project_template description TODO
homepage: "https://github.com/linode-obs/go_project_template"
license: "MIT"
contents:
# provided by goreleaser
- src: ./dist/go_project_template_linux_amd64_v1/go_project_template
dst: /usr/local/bin/go_project_template
- src: ./nfpm/systemd/go_project_template.service
dst: /etc/systemd/system/go_project_template.service
type: config
- src: ./nfpm/etc/default/go_project_template
dst: /etc/default/go_project_template
type: config
scripts:
postinstall: ./nfpm/scripts/postinstall.sh