Skip to content

Commit 0722814

Browse files
committedAug 13, 2020
updated releasing
1 parent 1aad254 commit 0722814

File tree

4 files changed

+68
-1
lines changed

4 files changed

+68
-1
lines changed
 

‎.goreleaser.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
# Make sure to check the documentation at http://goreleaser.com
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- darwin
8+
- windows
9+
- linux
10+
goarch:
11+
- amd64
12+
- arm
13+
- arm64
14+
ldflags:
15+
- -X main.Version={{.Version}}
16+
archives:
17+
- replacements:
18+
darwin: macOS
19+
linux: Linux
20+
windows: Windows
21+
386: i386
22+
amd64: x86_64
23+
checksum:
24+
name_template: 'checksums.txt'
25+
snapshot:
26+
name_template: "{{ .Tag }}"
27+
changelog:
28+
sort: asc
29+
filters:
30+
exclude:
31+
- '^docs:'
32+
- '^test:'

‎Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.PHONY: release
2+
3+
release:
4+
goreleaser --rm-dist

‎main.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import (
1414
"github.com/pkg/errors"
1515
)
1616

17+
// Version is set during build.
18+
var Version = "dev"
19+
1720
func main() {
1821
if err := run(os.Stdout, os.Args); err != nil {
1922
fmt.Fprintf(os.Stderr, "%s\n", err)
@@ -24,7 +27,7 @@ func main() {
2427
func run(stdout io.Writer, args []string) error {
2528
flags := flag.NewFlagSet(args[0], flag.ContinueOnError)
2629
flags.Usage = func() {
27-
fmt.Println(args[0] + ` usage:
30+
fmt.Println(args[0] + " " + Version + ` usage:
2831
oto [flags] paths [[path2] [path3]...]`)
2932
fmt.Println(`
3033
flags:`)

‎releasing.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Releasing
2+
3+
This tool uses Go Releaser to manage release builds.
4+
5+
## Setup
6+
7+
Install Go Releaser.
8+
9+
```bash
10+
brew install goreleaser/tap/goreleaser
11+
```
12+
13+
* Make a [New personal access token on GitHub](https://github.com/settings/tokens/new) and set it as the `GITHUB_TOKEN` environment variable
14+
15+
## Releasing
16+
17+
Tag the repo:
18+
19+
```bash
20+
$ git tag -a v0.1.0 -m "release tag."
21+
$ git push origin v0.1.0
22+
```
23+
24+
Then:
25+
26+
```bash
27+
make release
28+
```

0 commit comments

Comments
 (0)
Please sign in to comment.