-
Notifications
You must be signed in to change notification settings - Fork 40
/
.goreleaser.yml
191 lines (176 loc) · 5.77 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
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
before:
hooks:
- ./bin/go_mod_tidy # Get dependencies
project_name: secretless-broker
builds:
- &summon-2-build
id: summon2-linux
main: ./cmd/summon2/main.go
binary: summon2
env:
- CGO_ENABLED=1
# Tag 'netgo' is a Go build tag that ensures a pure Go networking stack
# in the resulting binary instead of using the default host's stack to
# ensure a fully statically-linked artifact that has no lib dependencies.
flags:
- -tags=netgo
goos:
- linux
goarch:
- amd64
# These flags generate a statically-linked artifact that allows the binary
# to run on any linux-based OS.
ldflags: -s -w -linkmode external -extldflags "-static"
- <<: *summon-2-build
id: summon2-darwin-amd64
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
- amd64
# Building for OSX with -extldflags "-static" results in the error:
# ld: library not found for -lcrt0.o
# This is because static builds are only possible if all libraries
# (including libgcc.a) have also been compiled with -static.
# A static version of crt0.o is not provided
# with the OSX SDK
ldflags: -s -w -linkmode external
- <<: *summon-2-build
id: summon2-darwin-arm64
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
goos:
- darwin
goarch:
- arm64
# Building for OSX with -extldflags "-static" results in the error:
# ld: library not found for -lcrt0.o
# This is because static builds are only possible if all libraries
# (including libgcc.a) have also been compiled with -static.
# A static version of crt0.o is not provided
# with the OSX SDK
ldflags: -s -w -linkmode external
- &secretless-broker-build
id: secretless-broker-linux
main: ./cmd/secretless-broker/main.go
binary: secretless-broker
env:
- CGO_ENABLED=1
# Tag 'netgo' is a Go build tag that ensures a pure Go networking stack
# in the resulting binary instead of using the default host's stack to
# ensure a fully static artifact that has no dependencies.
flags:
- -tags=netgo
goos:
- linux
goarch:
- amd64
# The `Tag` override is there to provide the git commit information in the
# final binary. See `Static long version tags` in the `Building` section
# of `CONTRIBUTING.md` for more information.
ldflags: -s -w -linkmode external -X "github.com/cyberark/secretless-broker/pkg/secretless.Tag={{ .ShortCommit }}" -extldflags "-static"
hooks:
post:
# Copy the binary out into the <dist> path, and give the copy the name we want
# in the release <extra_files>.
# e.g. Suppose a windows amd64 build generates a binary at
# path/to/secretless-broker.exe. This will be copied to
# path/to/../secretless-broker-windows_amd64.exe. The copy path can then be added to
# the release <extra_files> and will result in a release artifact with the name
# secretless-broker-windows_amd64.exe.
- cp "{{ .Path }}" "{{ dir .Path }}/../secretless-broker-{{.Target}}{{.Ext}}"
- <<: *secretless-broker-build
id: secretless-broker-darwin
env:
- CGO_ENABLED=1
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
- amd64
# Building for OSX with -extldflags "-static" results in the error:
# ld: library not found for -lcrt0.o
# This is because static builds are only possible if all libraries
# (including libgcc.a) have also been compiled with -static.
# A static version of crt0.o is not provided
# with the OSX SDK
ldflags: -s -w -linkmode external -X "github.com/cyberark/secretless-broker/pkg/secretless.Tag={{ .ShortCommit }}"
- <<: *secretless-broker-build
# Apple silicon support
id: secretless-broker-arm
env:
- CGO_ENABLED=1
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -tags=netgo
goos:
- darwin
goarch:
- arm64
# Building for OSX with -extldflags "-static" results in the error:
# ld: library not found for -lcrt0.o
# This is because static builds are only possible if all libraries
# (including libgcc.a) have also been compiled with -static.
# A static version of crt0.o is not provided
# with the OSX SDK
ldflags: -s -w -linkmode external -X "github.com/cyberark/secretless-broker/pkg/secretless.Tag={{ .ShortCommit }}"
archives:
- id: secretless-release-archive
files:
- CHANGELOG.md
- NOTICES.txt
- LICENSE
- README.md
format_overrides:
- goos: windows
format: zip
name_template: "{{.ProjectName}}_{{.Env.VERSION}}_{{.Os}}_{{.Arch}}"
wrap_in_directory: true
checksum:
name_template: 'SHA256SUMS.txt'
dist: ./dist/goreleaser
brews:
- description: Secures your apps by making them Secretless
homepage: https://secretless.io
url_template: https://github.com/cyberark/secretless-broker/releases/download/v{{.Env.VERSION}}/secretless-broker_{{.Env.VERSION}}_{{.Os}}_{{.Arch}}.tar.gz
install: |
bin.install "secretless-broker"
test: |
system "#{bin}/secretless-broker", "-version"
tap:
owner: cyberark
name: homebrew-tools
skip_upload: true
nfpms:
- bindir: /usr/bin
description: Secures your apps by making them Secretless
contents:
- dst: /usr/local/lib/secretless
type: dir
formats:
- deb
- rpm
homepage: https://secretless.io
license: "Apache 2.0"
maintainer: CyberArk Maintainers <[email protected]>
file_name_template: "{{.ProjectName}}_{{.Env.VERSION}}_{{.Arch}}"
vendor: CyberArk
snapshot:
name_template: "{{ .Tag }}-next"
release:
disable: true #Goreleaser releasing is disabled to allow the automated release process to handle Github releases
draft: true
extra_files:
- glob: NOTICES.txt
- glob: LICENSE
- glob: CHANGELOG.md
- glob: dist/goreleaser/secretless-broker-linux_amd64
- glob: dist/goreleaser/secretless-broker-darwin_amd64
- glob: dist/goreleaser/secretless-broker-darwin_arm64