Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample GoReleaser yaml
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: project_name
env_files:
github_token: ~/.config/goreleaser/github_token //Create a github token for a particular repository where the
//releaser is going to push files and add it in your local .config folder
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
builds:
- # Build macOS, Linux and Windows versions
main: ./path_to_main.go file/main.go
env:
- CGO_ENABLED=0
goos: // enabling Go OS for Linux, windows and darwin
- linux
- windows
- darwin
goarch:
- amd64
- arm64
targets:
- linux_amd64
- darwin_amd64
- darwin_arm64
- windows_amd64
ldflags:
- -s -w
# .goreleaser.yml
brews:
- # GitHub/GitLab repository to push the formula to
tap:
owner: any_owner_name
name: cli
name: brew_installer_name
# Template for the url which is determined by the given Token (github or gitlab)
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
homepage: https://github.com/homepage
# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: name
email: xyz@mail.com
folder: Formula
# Caveats for the user of your binary.
# Default is empty.
caveats: ""
# Your app's description.
# Default is empty.
description: ""
# SPDX identifier of your app's license.
# Default is empty.
license: "MIT"
# Packages your package depends on.
dependencies:
- name: git
- name: go
archives:
- #Replacements for GOOS and GOARCH in the archive name
replacements:
darwin: macOS
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^*.md:"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment