-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.goreleaser.yml
96 lines (88 loc) · 3.09 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
version: 2
project_name: conjur-cli-go
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
builds:
- main: ./cmd/conjur
binary: conjur
env:
- CGO_ENABLED=0
# 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.
# However, netgo on Windows has a bug that prevents it from using the
# machine's hosts file for DNS resolution. Therefore this tag must be
# omitted on Windows until the bug is fixed. See
# https://github.com/golang/go/issues/57757 and internal ticket
# CNJR-904 for more information.
flags:
- -tags={{ if ne .Os "windows" }}netgo{{ end }}
- -a
goos:
- linux
- darwin
- windows
goamd64:
- v1
# 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:
- -w
- -X "github.com/cyberark/conjur-cli-go/pkg/version.Tag={{ .ShortCommit }}"
- -X "github.com/cyberark/conjur-cli-go/pkg/version.Version={{ .Env.VERSION }}"
hooks:
post:
# Copy the separately-built FIPS binaries into the GoReleaser build directory
- cmd: sh -c "cp -Rf {{ dir .Path }}/../../fips/* {{ dir .Path }}/../"
output: true
# 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/binary.exe. This will be copied to
# path/to/../binary-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
# binary-windows_amd64.exe.
- mkdir -p "{{ dir .Path }}/../binaries"
- cp "{{ .Path }}" "{{ dir .Path }}/../binaries/conjur_{{ .Target }}{{ .Ext }}"
archives:
- id: conjur-cli-go-archive
files:
- CHANGELOG.md
- 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"
brews:
- name: conjur-cli
description: CyberArk Conjur command line interface
homepage: https://conjur.org
url_template: https://github.com/cyberark/conjur-cli-go/releases/download/v{{.Env.VERSION}}/conjur-cli-go_{{.Env.VERSION}}_{{.Os}}_{{.Arch}}.tar.gz
install: |
bin.install "conjur"
test: |
system "#{bin}/conjur", "--version"
repository:
owner: cyberark
name: homebrew-tools
skip_upload: true
snapshot:
name_template: "{{ .Tag }}-next"
dist: dist/goreleaser/
release:
disable: true
draft: true
extra_files:
- glob: NOTICES.txt
- glob: CHANGELOG.md
- glob: LICENSE
- glob: dist/goreleaser/binaries