Skip to content

Instantly share code, notes, and snippets.

@developer-guy
Created August 31, 2021 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save developer-guy/1accbae945e7216b2faa930f17980746 to your computer and use it in GitHub Desktop.
Save developer-guy/1accbae945e7216b2faa930f17980746 to your computer and use it in GitHub Desktop.
whole goreleaser
project_name: kink
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod tidy
- go mod download
builds:
- id: linux-amd64
binary: kink-linux-{{ .Arch }}
main: ./main.go
goos:
- linux
goarch:
- amd64
ldflags:
- "{{ .Env.LDFLAGS }}"
no_unique_dist_dir: true
- id: darwin-amd64
binary: kink-darwin-{{ .Arch }}
main: ./main.go
goos:
- darwin
goarch:
- amd64
ldflags:
- "{{ .Env.LDFLAGS }}"
no_unique_dist_dir: true
- id: windows-amd64
binary: kink-windows-{{ .Arch }}
main: ./main.go
goos:
- windows
goarch:
- amd64
ldflags:
- -buildmode=exe
- "{{ .Env.LDFLAGS }}"
no_unique_dist_dir: true
dockers:
- image_templates: [ "registry.private.com/platform/base/poc/kink:{{ .Tag }}" ]
dockerfile: Dockerfile.goreleaser
goos: linux
goarch: amd64
build_flag_templates:
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://gitlab.com/goreleaser/example
- --label=org.opencontainers.image.source=https://gitlab.com/goreleaser/example
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
gomod:
proxy: true
env:
- GOPRIVATE=gitlab.private.com
archives:
- format: tar.gz
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
name_template: '{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}'
files:
- README.md
- LICENSE
checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
snapshot:
name_template: SNAPSHOT-{{.ShortCommit}}
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- 'README'
- Merge pull request
- Merge branch
# .goreleaser.yml
gitlab_urls:
api: https://gitlab.private.com/api/v4/
download: https://gitlab.private.com
skip_tls_verify: false
release:
gitlab:
owner: ""
name: 8141
disable: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment