Skip to content

Commit

Permalink
Use goreleaser for releases
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <[email protected]>
  • Loading branch information
teran committed Dec 1, 2018
1 parent 89a84e7 commit 3506e13
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ pkg/
*.out
.glide/
.DS_Store
dist/
vendor/
31 changes: 31 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
- freebsd
goarch:
- 386
- amd64
- arm
- arm64
archive:
replacements:
386: i386
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
sign:
artifacts: checksum
4 changes: 3 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ func (c *config) Metadata() map[string]flag.Flag {

version = fmt.Sprintf(`
version: %s
commit: %s
built with: %s
`, Version, runtime.Version())
built at: %s
`, version, commit, runtime.Version(), date)

desc = `
checksum creates database (actually just a JSON file) to store file length, SHA1, SHA256
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
var (
wg sync.WaitGroup

// Version - variable to store current commit,tag,whatever
Version = "No version specified(probably trunk build)"
version = "No version specified(probably trunk build)"
commit = "master"
date = "0000-00-00 00:00:00"

db *database.Database
filePattern *regexp.Regexp
Expand Down
2 changes: 1 addition & 1 deletion operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func verify(path string, length int64, sha1, sha256 string) bool {
}

func printVersion() {
fmt.Printf("checksum version: %s\n", Version)
fmt.Printf("checksum version: %s\n", version)
fmt.Printf("Built wih Go version: %s\n", runtime.Version())
}

Expand Down

0 comments on commit 3506e13

Please sign in to comment.