forked from restic/rest-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.goreleaser.yml
108 lines (95 loc) · 2.55 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
---
before:
# Run a few commands to check the state of things. When anything is changed
# in files commited to the repo, goreleaser will abort before building
# anything because the git checkout is dirty.
hooks:
# make sure all modules are available
- go mod download
# make sure all generated code is up to date
- go generate ./...
# check that $VERSION is set
- test -n "{{ .Env.VERSION }}"
# make sure the file VERSION contains the latest version (used for build.go)
- bash -c 'echo "{{ .Env.VERSION }}" > VERSION'
# make sure that main.go contains the latest version
- echo sed -i 's/var version = "[^"]*"/var version = "{{ .Env.VERSION }}"/' cmd/rest-server/main.go
# make sure the file CHANGELOG.md is up to date
- calens --output CHANGELOG.md
# build a single binary
builds:
-
# make sure everything is statically linked by disabling cgo altogether
env:
- CGO_ENABLED=0
# set the package for the main binary
main: ./cmd/rest-server
flags:
# don't include any paths to source files in the resulting binary
- -trimpath
ldflags:
# set the version variable in the main package
- "-s -w -X main.version={{ .Version }}"
# list all operating systems and architectures we build binaries for
goos:
- linux
- darwin
- windows
- freebsd
- netbsd
- openbsd
- dragonfly
- solaris
goarch:
- amd64
- 386
- arm
- arm64
- mips
- mips64
- mips64le
- ppc64
- ppc64le
goarm:
- 6
- 7
# configure the resulting archives to create
archives:
-
# package a directory which contains the source file
wrap_in_directory: true
# add these files to all archives
files:
- LICENSE
- README.md
- CHANGELOG.md
# also build an archive of the source code
source:
enabled: true
# build a file containing the SHA256 hashes
checksum:
name_template: 'SHA256SUMS'
# sign the checksum file
signs:
- artifacts: checksum
signature: "${artifact}.asc"
args:
- "--armor"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
# do not generate a changelog file, we're using calens for that
changelog:
skip: true
# configure building the rest-server docker image
dockers:
- image_templates:
- restic/rest-server:latest
- restic/rest-server:{{ .Version }}
build_flag_templates:
- "--pull"
extra_files:
- docker/create_user
- docker/delete_user
- docker/entrypoint.sh