-
Notifications
You must be signed in to change notification settings - Fork 2
/
.goreleaser.yml
148 lines (138 loc) · 4.34 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
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
project_name: sdpctl
env:
- SNAPSHOT_VERSION={{ .Now.Format "2006.01.02" }}
- SDPCTL_LOG_LEVEL={{ if .IsSnapshot }}debug{{ else }}info{{ end }}
before:
hooks:
- make clean
- make deps
snapshot:
name_template: "{{ if .IsSnapshot }}{{ .Env.SNAPSHOT_VERSION }}{{ else }}{{ .Tag }}{{ end }}"
changelog:
use: github-native
github_urls:
download: https://github.com/appgate/sdpctl/releases
builds:
- <<: &build_defaults
binary: "{{ .ProjectName }}"
main: ./main.go
buildmode: pie
flags:
- -trimpath
ldflags:
- -s -w -X "github.com/appgate/sdpctl/cmd.version={{ if .IsSnapshot }}{{ .Env.SNAPSHOT_VERSION }}-dev{{ else }}{{ .Version }}{{ end }}"
- -X "github.com/appgate/sdpctl/cmd.commit={{ .FullCommit }}"
- -X "github.com/appgate/sdpctl/cmd.buildDate={{ .Date }}"
- -X "github.com/appgate/sdpctl/pkg/factory.dockerRegistry={{ .Env.DOCKER_REGISTRY_URL }}"
id: linux
goos: [linux]
goarch: [amd64, arm64]
env:
- CGO_ENABLED=0
- <<: *build_defaults
id: macos
goos: [darwin]
goarch: [arm64, amd64]
env:
- CGO_ENABLED=1
hooks:
post:
- "{{ .Env.HOOK_PATH }}/sign-macos.sh '{{ .Path }}'"
- <<: *build_defaults
id: windows
goos: [windows]
goarch: [amd64]
env:
- CGO_ENABLED=0
hooks:
post:
- "{{ .Env.HOOK_PATH }}/sign-windows.sh '{{ .Path }}'"
universal_binaries:
- replace: false
id: macos
archives:
- format_overrides:
- goos: windows
format: zip
checksum:
name_template: "checksums.txt"
nfpms:
- homepage: https://www.appgate.com
maintainer: Appgate Cybersecurity Inc <appgatesdp.support@appgate.com>
description: |-
Official command line tool for managing
Appgate SDP Collectives
license: MIT
vendor: Appgate Cybersecurity, Inc
section: utils
formats:
- deb
- rpm
contents:
- src: ./build/bash_completion
dst: /usr/share/bash-completion/completions/sdpctl
file_info:
mode: 0644
group: root
- src: ./build/man/*.gz
dst: /usr/share/man/man3/
file_info:
group: root
mode: 0644
- src: LICENSE
dst: /usr/share/doc/sdpctl/copyright
file_info:
group: root
mode: 0644
deb:
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package
- groff-message
- no-manual-page
rpm:
compression: gzip
release:
github:
owner: appgate
name: sdpctl
draft: true
brews:
- name: sdpctl
commit_author:
name: "{{ .Env.COMMIT_AUTHOR_NAME }}"
email: "{{ .Env.COMMIT_AUTHOR_EMAIL }}"
commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
folder: Formula
homepage: "https://github.com/appgate/sdpctl/releases"
description: "Official CLI tool for managing Appgate SDP Collectives"
license: "MIT"
url_template: "https://github.com/appgate/sdpctl/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
install: |
bin.install "sdpctl"
generate_completions_from_executable("#{bin}/sdpctl", "completion", shells: [:bash, :zsh, :fish])
test: |
version_output = shell_output("#{bin}/sdpctl --version")
assert_match "sdpctl version #{version}", version_output.split("\n")[0]
profile_add = shell_output("#{bin}/sdpctl profile add test")
expected = "Created profile test, run 'sdpctl profile list' to see all available profiles\n" \
"run 'sdpctl profile set test' to select the new profile"
assert_match expected, profile_add
profile_set = shell_output("#{bin}/sdpctl profile set test")
expected = "test is selected as current sdp profile\n" \
"test is not configured yet, run 'sdpctl configure'"
assert_match expected, profile_set
configure = shell_output("#{bin}/sdpctl configure https://example.com:8443")
expected = "Configuration updated successfully"
assert_match expected, configure
repository:
owner: appgate
name: homebrew-tap
branch: "{{.ProjectName}}-{{.Tag}}"
pull_request:
enabled: true
base:
owner: appgate
name: homebrew-tap
branch: main