diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..55295d3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,33 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +builds: + - env: + - CGO_ENABLED=0 + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - arm + - arm64 + ldflags: + - -X main.version={{.Version}} + archives: + - replacements: + darwin: macOS + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + checksum: + name_template: 'checksums.txt' + snapshot: + name_template: "{{.Tag}}" + changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9eeafe7 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: release + +release: + goreleaser --rm-dist diff --git a/main.go b/main.go index 42011b1..d6a5c8e 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,9 @@ import ( "github.com/matryer/moq/pkg/moq" ) +// version is the command version, injected at build time. +var version string + type userFlags struct { outFile string pkgName string diff --git a/releasing.md b/releasing.md new file mode 100644 index 0000000..c5bea44 --- /dev/null +++ b/releasing.md @@ -0,0 +1,28 @@ +# Releasing + +This tool uses Go Releaser to manage release builds. + +## Setup + +Install Go Releaser. + +```bash +brew install goreleaser/tap/goreleaser +``` + +* Make a [New personal access token on GitHub](https://github.com/settings/tokens/new) and set it as the `GITHUB_TOKEN` environment variable + +## Releasing + +Tag the repo: + +```bash +$ git tag -a v0.1.0 -m "release tag." +$ git push origin v0.1.0 +``` + +Then: + +```bash +make release +```