Skip to content

Commit

Permalink
CLOUDP-245765: Add goreleaser to mongodb/openapi repo (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaangiolillo authored Apr 25, 2024
1 parent 0fb7c3f commit 3a78e3f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions tools/cli/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
project_name: openapicli
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- <<: &build_defaults
env:
- CGO_ENABLED=0
binary: bin/openapicli
main: ./cmd/openapicli.go
ldflags:
- -s -w -X github.com/mongodb/openapi/tools/cli/internal/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit={{.FullCommit}}
id: linux
goos: [linux]
goarch: [amd64,arm64]
- <<: *build_defaults
id: macos
goos: [darwin]
goarch: [amd64,arm64]

gomod: # https://goreleaser.com/customization/verifiable_builds/
# Proxy a module from proxy.golang.org, making the builds verifiable.
# This will only be effective if running against a tag. Snapshots will ignore
# this setting.
# Notice: for this to work your `build.main` must be a package, not a `.go` file.
proxy: false
# Sets the `-mod` flag value.
#
# Since: v1.7
mod: mod

archives:
- id: linux_archives
name_template: mongodb-openapi-cli_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
builds: [linux]
wrap_in_directory: true
format: tar.gz
rlcp: false
- id: macos
name_template: mongodb-openapi-cli_{{ .Version }}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
builds: [macos]
format: zip
wrap_in_directory: false
rlcp: false

snapshot:
name_template: "{{ .Env.VERSION_GIT }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^chore:'
- '^build(deps):'

release:
prerelease: auto
name_template: "OpenAPI CLI {{.Version}}"


0 comments on commit 3a78e3f

Please sign in to comment.