-
Notifications
You must be signed in to change notification settings - Fork 62
/
.goreleaser.yml
148 lines (134 loc) · 4.21 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
# all available options: https://goreleaser.com/customization/
version: 2
project_name: summon
before:
hooks:
- go mod download
builds:
- id: summon
binary: summon
env:
- CGO_ENABLED=0
flags:
- -tags=netgo
goos:
- darwin # MacOS
- solaris
- windows
goarch:
- amd64
ldflags:
- -s -w
- -X "github.com/cyberark/summon/pkg/summon.Tag={{ .ShortCommit }}"
- -X "github.com/cyberark/summon/pkg/summon.Version={{ .Env.VERSION }}"
main: ./cmd/main.go
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/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/summon_{{ .Target }}{{ .Ext }}"
# Arm support
- id: summon-arm
binary: summon
env:
- CGO_ENABLED=0
flags:
- -tags=netgo
goos:
- darwin # MacOS
- linux
goarch:
- arm64
ldflags:
- -s -w
- -X "github.com/cyberark/summon/pkg/summon.Tag={{ .ShortCommit }}"
- -X "github.com/cyberark/summon/pkg/summon.Version={{ .Env.VERSION }}"
main: ./cmd/main.go
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/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/summon_{{ .Target }}{{ .Ext }}"
# Make a static build for Linux
- id: summon-linux
binary: summon
env:
- CGO_ENABLED=1
flags:
- -tags=netgo
goos:
- linux
goarch:
- amd64
ldflags:
- -s -w
- -X "github.com/cyberark/summon/pkg/summon.Tag={{ .ShortCommit }}"
- -X "github.com/cyberark/summon/pkg/summon.Version={{ .Env.VERSION }}"
- -linkmode external -extldflags "-static"
main: ./cmd/main.go
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/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/summon-{{ .Target }}{{ .Ext }}"
archives:
- id: summon-release-archive
name_template: "{{.ProjectName}}-{{.Os}}-{{.Arch}}"
format_overrides:
- goos: windows
format: zip
files:
- none* # only package the binary - not defaults: readme, license, changelog
checksum:
name_template: 'SHA256SUMS.txt'
brews:
- description: CLI that provides on-demand secrets access for common DevOps tools.
homepage: https://github.com/cyberark/summon
url_template: https://github.com/cyberark/summon/releases/download/v{{.Version}}/summon-{{ tolower .Os }}-{{ tolower .Arch }}.tar.gz
install: |
bin.install "summon"
test: |
system "#{bin}/summon", "-v"
repository:
owner: cyberark
name: homebrew-tools
skip_upload: true
nfpms:
- file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}"
vendor: CyberArk
homepage: https://github.com/cyberark/summon
maintainer: Conjur Maintainers <conj_maintainers@cyberark.com>
description: CLI that provides on-demand secrets access for common DevOps tools.
recommends:
- summon-conjur
license: MIT
formats:
- deb
- rpm
- apk
bindir: /usr/local/bin
dist: ./dist/goreleaser
release:
disable: true
draft: true
extra_files:
- glob: LICENSE
- glob: CHANGELOG.md