Skip to content

Commit

Permalink
add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
cxjava committed Nov 14, 2019
1 parent 0d757dd commit 7e9b3de
Showing 1 changed file with 59 additions and 5 deletions.
64 changes: 59 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,72 @@
project_name: gosuv

env:
- GO111MODULE=on

before:
hooks:
- go generate ./...

builds:
-
- id: default
binary: gosuv
env:
- CGO_ENABLED=0
ldflags:
- "-s -w"
- -X "main.Version={{.Version}}"
- -X "main.Commit={{.FullCommit}}"
- -X "main.RepoUrl={{.GitURL}}"
- -X "main.BuildDate={{.Date}}"
- -X "main.BuiltWithGoVersion={{.Env.GO_VERSION}}"
- -X "main.BuiltBy={{.Env.BUILT_BY}}"
flags:
- -tags=release
goos:
- linux
- darwin
- windows
- darwin
- linux
goarch:
- 386
- amd64
- arm
goarm:
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm
flags: -tags vfs
hooks:
pre: go generate
post: ./upx.sh
archives:
- id: binary
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format: tar.gz
format_overrides:
- goos: windows
format: zip
builds:
- default
wrap_in_directory: true
files:
- none*
replacements:
amd64: 64-bit
386: 32-bit
arm: ARM
arm64: ARM64
darwin: macOS
linux: Linux
windows: Windows
openbsd: OpenBSD
netbsd: NetBSD
freebsd: FreeBSD
release:
github:
owner: cxjava
name: gosuv
draft: true
prerelease: auto
name_template: "{{.ProjectName}}-v{{.Version}}-{{.ShortCommit}}-{{.Date}}"

0 comments on commit 7e9b3de

Please sign in to comment.