File tree 4 files changed +68
-1
lines changed
4 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
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:'
Original file line number Diff line number Diff line change
1
+ .PHONY : release
2
+
3
+ release :
4
+ goreleaser --rm-dist
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ import (
14
14
"github.com/pkg/errors"
15
15
)
16
16
17
+ // Version is set during build.
18
+ var Version = "dev"
19
+
17
20
func main () {
18
21
if err := run (os .Stdout , os .Args ); err != nil {
19
22
fmt .Fprintf (os .Stderr , "%s\n " , err )
@@ -24,7 +27,7 @@ func main() {
24
27
func run (stdout io.Writer , args []string ) error {
25
28
flags := flag .NewFlagSet (args [0 ], flag .ContinueOnError )
26
29
flags .Usage = func () {
27
- fmt .Println (args [0 ] + ` usage:
30
+ fmt .Println (args [0 ] + " " + Version + ` usage:
28
31
oto [flags] paths [[path2] [path3]...]` )
29
32
fmt .Println (`
30
33
flags:` )
Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments