testing releasing

This commit is contained in:
matryer 2020-09-02 10:30:40 +01:00
parent 720d53e65d
commit 9581d77413
4 changed files with 68 additions and 0 deletions

33
.goreleaser.yml Normal file
View File

@ -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:'

4
Makefile Normal file
View File

@ -0,0 +1,4 @@
.PHONY: release
release:
goreleaser --rm-dist

View File

@ -13,6 +13,9 @@ import (
"github.com/matryer/moq/pkg/moq" "github.com/matryer/moq/pkg/moq"
) )
// version is the command version, injected at build time.
var version string
type userFlags struct { type userFlags struct {
outFile string outFile string
pkgName string pkgName string

28
releasing.md Normal file
View File

@ -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
```