-
Notifications
You must be signed in to change notification settings - Fork 60
/
.goreleaser.yml
189 lines (174 loc) · 5.44 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
# https://goreleaser.com/customization/project/
project_name: fastly
version: 2
# https://goreleaser.com/customization/release/
release:
draft: true
prerelease: auto
extra_files:
- glob: "dist/usage.json"
# https://goreleaser.com/customization/hooks/
before:
hooks:
- go mod tidy
- go mod download
# https://goreleaser.com/customization/builds/
builds:
- <<: &build_defaults
main: ./cmd/fastly
ldflags:
- -s -w -X "github.com/fastly/cli/pkg/revision.AppVersion=v{{ .Version }}"
- -X "github.com/fastly/cli/pkg/revision.GitCommit={{ .ShortCommit }}"
- -X "github.com/fastly/cli/pkg/revision.GoHostOS={{ .Env.GOHOSTOS }}"
- -X "github.com/fastly/cli/pkg/revision.GoHostArch={{ .Env.GOHOSTARCH }}"
- -X "github.com/fastly/cli/pkg/revision.Environment=release"
env:
- CGO_ENABLED=0
id: macos
goos: [darwin]
goarch: [amd64, arm64]
- <<: *build_defaults
env:
- CGO_ENABLED=0
id: linux
goos: [linux]
goarch: ["386", amd64, arm64]
- <<: *build_defaults
env:
- CGO_ENABLED=0
id: windows
goos: [windows]
goarch: ["386", amd64, arm64]
- <<: *build_defaults
env:
- CGO_ENABLED=0
id: generate-usage
goos: [linux]
goarch: [amd64]
binary: 'fastly-usage' # we rename the binary to prevent an error caused by the earlier 'linux/amd64' step
# which already creates a 'fastly' binary in '/usr/local/bin'.
hooks:
post:
- cmd: "scripts/documentation.sh {{ .Path }}"
# https://goreleaser.com/customization/archive/
archives:
- id: nix
builds: [macos, linux]
<<: &archive_defaults
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- none*
wrap_in_directory: false
format: tar.gz
- id: windows-tar
builds: [windows]
<<: *archive_defaults
wrap_in_directory: false
format: tar.gz
- id: windows-zip
builds: [windows]
<<: *archive_defaults
wrap_in_directory: false
format: zip
# https://goreleaser.com/customization/aur/
aurs:
-
homepage: "https://github.com/fastly/cli"
description: "A CLI for interacting with the Fastly platform"
maintainers:
license: "Apache license 2.0"
skip_upload: auto
provides:
- fastly
conflicts:
- fastly
# The SSH private key that should be used to commit to the Git repository.
# This can either be a path or the key contents.
#
# WARNING: do not expose your private key in the config file!
private_key: '{{ .Env.AUR_KEY }}'
# The AUR Git URL for this package.
# Defaults to empty.
git_url: 'ssh://[email protected]/fastly-bin.git'
# List of packages that are not needed for the software to function,
# but provide additional features.
#
# Must be in the format `package: short description of the extra functionality`.
#
# Defaults to empty.
optdepends:
- 'viceroy: for running service locally'
# The value to be passed to `GIT_SSH_COMMAND`.
#
#
# Defaults to `ssh -i {{ .KeyPath }} -o StrictHostKeyChecking=accept-new -F /dev/null`.
git_ssh_command: 'ssh -i {{ .KeyPath }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -F /dev/null'
# https://goreleaser.com/customization/homebrew/
brews:
- name: fastly
ids: [nix]
repository:
owner: fastly
name: homebrew-tap
skip_upload: auto
description: A CLI for interacting with the Fastly platform
homepage: https://github.com/fastly/cli
directory: Formula
custom_block: |
head do
url "https://github.com/fastly/cli.git"
depends_on "go"
end
install: |
system "make" if build.head?
bin.install "fastly"
(bash_completion/"fastly.sh").write `#{bin}/fastly --completion-script-bash`
(zsh_completion/"_fastly").write `#{bin}/fastly --completion-script-zsh`
test: |
help_text = shell_output("#{bin}/fastly --help")
assert_includes help_text, "Usage:"
# https://goreleaser.com/customization/nfpm/
nfpms:
- license: Apache 2.0
maintainer: Fastly
homepage: https://github.com/fastly/cli
bindir: /usr/local/bin
description: CLI tool for interacting with the Fastly API.
formats:
- deb
- rpm
contents:
- src: deb-copyright
dst: /usr/share/doc/fastly/copyright
packager: deb
# https://goreleaser.com/customization/checksum/
checksum:
name_template: "{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS"
# https://goreleaser.com/customization/snapshots/
snapshot:
version_template: "{{ .Tag }}-next"
# https://goreleaser.com/customization/changelog/
changelog:
disable: true
# https://goreleaser.com/customization/docker/
# dockers:
# - <<: &build_opts
# use: buildx
# goos: linux
# goarch: amd64
# image_templates:
# - "ghcr.io/fastly/cli:{{ .Version }}"
# build_flag_templates:
# - "--platform=linux/amd64"
# - --label=title={{ .ProjectName }}
# - --label=description={{ .ProjectName }}
# - --label=url=https://github.com/fastly/cli
# - --label=source=https://github.com/fastly/cli
# - --label=version={{ .Version }}
# - --label=created={{ time "2006-01-02T15:04:05Z07:00" }}
# - --label=revision={{ .FullCommit }}
# - --label=licenses=Apache-2.0
# dockerfile: Dockerfile-assemblyscript
# - <<: *build_opts
# dockerfile: Dockerfile-rust