Use goreleaser to build releases and also publish Homebrew formula
Created by: mrnugget
I discovered GoReleaser a few days ago when I found out that Github's new gh
CLI is automatically released as a Homebrew formula: https://github.com/github/homebrew-gh
That would be really nice to have. Now, I'm not sure whether the config here works as intended.
Doing a dry-run release locally seems to work:
goreleaser --snapshot --skip-publish --rm-dist
• releasing using goreleaser 0.126.0...
• loading config file file=.goreleaser.yml
• RUNNING BEFORE HOOKS
• running go mod download
• running go mod tidy
• LOADING ENVIRONMENT VARIABLES
• pipe skipped error=publishing is disabled
• GETTING AND VALIDATING GIT STATE
• releasing 3.10.8, commit f907940b61d30be8c115c8f0940e48c9dda556e8
• pipe skipped error=disabled during snapshot mode
• PARSING TAG
• SETTING DEFAULTS
• LOADING ENVIRONMENT VARIABLES
• SNAPSHOTING
• GITHUB/GITLAB/GITEA RELEASES
• PROJECT NAME
• BUILDING BINARIES
• ARCHIVES
• LINUX PACKAGES WITH NFPM
• SNAPCRAFT PACKAGES
• CALCULATING CHECKSUMS
• SIGNING ARTIFACTS
• DOCKER IMAGES
• ARTIFACTORY
• BLOB
• HOMEBREW TAP FORMULA
• optimistically guessing `brew[0].installs`, double check
• SCOOP MANIFEST
• SNAPSHOTING
• CHECKING ./DIST
• --rm-dist is set, cleaning it up
• WRITING EFFECTIVE CONFIG FILE
• writing config=release/config.yaml
• GENERATING CHANGELOG
• pipe skipped error=not available for snapshots
• BUILDING BINARIES
• building binary=/Users/thorstenball/work/src-cli/release/src-cli_windows_amd64/src.exe
• building binary=/Users/thorstenball/work/src-cli/release/src-cli_darwin_amd64/src
• building binary=/Users/thorstenball/work/src-cli/release/src-cli_linux_amd64/src
• ARCHIVES
• creating archive=release/src-cli_3.10.8-SNAPSHOT-f907940_windows_amd64.tar.gz
• creating archive=release/src-cli_3.10.8-SNAPSHOT-f907940_darwin_amd64.tar.gz
• creating archive=release/src-cli_3.10.8-SNAPSHOT-f907940_linux_amd64.tar.gz
• LINUX PACKAGES WITH NFPM
• SNAPCRAFT PACKAGES
• CALCULATING CHECKSUMS
• checksumming file=src-cli_3.10.8-SNAPSHOT-f907940_darwin_amd64.tar.gz
• checksumming file=src-cli_3.10.8-SNAPSHOT-f907940_linux_amd64.tar.gz
• checksumming file=src-cli_3.10.8-SNAPSHOT-f907940_windows_amd64.tar.gz
• SIGNING ARTIFACTS
• pipe skipped error=artifact signing is disabled
• DOCKER IMAGES
• pipe skipped error=docker section is not configured
• PUBLISHING
• pipe skipped error=publishing is disabled
• release succeeded after 2.71s
But that also includes the snapshots and I'm mostly concerned about the Travis CI configuration.
I moved the secret
token from the deply
configuration to the global env vars, since goreleaser
expects a GITHUB_TOKEN
env var, but since I don't have an encryption key, I'm not sure what's in the secret
(cc @slimsag)