Skip to content

Commit 3a78e3f

Browse files
CLOUDP-245765: Add goreleaser to mongodb/openapi repo (#20)
1 parent 0fb7c3f commit 3a78e3f

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

tools/cli/.goreleaser.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Visit https://goreleaser.com for documentation on how to customize this
2+
# behavior.
3+
project_name: openapicli
4+
before:
5+
hooks:
6+
# this is just an example and not a requirement for provider building/publishing
7+
- go mod tidy
8+
builds:
9+
- <<: &build_defaults
10+
env:
11+
- CGO_ENABLED=0
12+
binary: bin/openapicli
13+
main: ./cmd/openapicli.go
14+
ldflags:
15+
- -s -w -X github.com/mongodb/openapi/tools/cli/internal/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit={{.FullCommit}}
16+
id: linux
17+
goos: [linux]
18+
goarch: [amd64,arm64]
19+
- <<: *build_defaults
20+
id: macos
21+
goos: [darwin]
22+
goarch: [amd64,arm64]
23+
24+
gomod: # https://goreleaser.com/customization/verifiable_builds/
25+
# Proxy a module from proxy.golang.org, making the builds verifiable.
26+
# This will only be effective if running against a tag. Snapshots will ignore
27+
# this setting.
28+
# Notice: for this to work your `build.main` must be a package, not a `.go` file.
29+
proxy: false
30+
# Sets the `-mod` flag value.
31+
#
32+
# Since: v1.7
33+
mod: mod
34+
35+
archives:
36+
- id: linux_archives
37+
name_template: mongodb-openapi-cli_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
38+
builds: [linux]
39+
wrap_in_directory: true
40+
format: tar.gz
41+
rlcp: false
42+
- id: macos
43+
name_template: mongodb-openapi-cli_{{ .Version }}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
44+
builds: [macos]
45+
format: zip
46+
wrap_in_directory: false
47+
rlcp: false
48+
49+
snapshot:
50+
name_template: "{{ .Env.VERSION_GIT }}-next"
51+
changelog:
52+
sort: asc
53+
filters:
54+
exclude:
55+
- '^docs:'
56+
- '^test:'
57+
- '^chore:'
58+
- '^build(deps):'
59+
60+
release:
61+
prerelease: auto
62+
name_template: "OpenAPI CLI {{.Version}}"
63+
64+

0 commit comments

Comments
 (0)