-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy path.goreleaser.yml
More file actions
148 lines (138 loc) · 4.09 KB
/
Copy path.goreleaser.yml
File metadata and controls
148 lines (138 loc) · 4.09 KB
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
# 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.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
ids: [macos, linux]
<<: &archive_defaults
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- none*
wrap_in_directory: false
formats: [tar.gz]
- id: windows-tar
ids: [windows]
<<: *archive_defaults
wrap_in_directory: false
formats: [tar.gz]
- id: windows-zip
ids: [windows]
<<: *archive_defaults
wrap_in_directory: false
formats: [zip]
# https://goreleaser.com/customization/homebrew/
brews:
- name: fastly
ids: [nix]
repository:
owner: fastly
name: homebrew-tap
skip_upload: true # Formula will be uploaded by publish_release workflow
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-node
# - <<: *build_opts
# dockerfile: Dockerfile-rust