Skip to content

Commit

Permalink
goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
barnybug committed May 31, 2018
1 parent 8f8491c commit b31acbf
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ _testmain.go
*.prof
cast
release/
/dist/
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
builds:
- binary: cast
main: ./cmd/cast
ldflags: -s -w -X=github.com/barnybug/go-cast.Version={{.Version}}
goos:
- linux
- darwin
- windows
goarch:
- amd64
- 386
- arm
- arm64
ignore:
- goos: darwin
goarch: 386
hooks:
post: make upx
archive:
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
format: binary
replacements:
darwin: mac
23 changes: 4 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
language: go
go:
- 1.7
- tip
- '1.10'
sudo: false
before_script:
- 'mkdir -p $GOPATH/bin && wget -q https://github.com/barnybug/go-cast/releases/download/deps/upx -O $GOPATH/bin/upx && chmod +x $GOPATH/bin/upx'
script:
- make deps build test
before_deploy:
- make release
deploy:
provider: releases
api_key:
secure: pC1oVY2F5AKp39oxzpTVEiwNZN4R7QCScbP49x++45j9G7ZenoxTR2tuFC1tGtXtgcarfLksO124Ny+zb08SbwiocbmUVejGAyize6Vvq6shDsBopg7ognzHSBdt8LTzYdmKmvgUEs6ZipXPJduSHPbk7LknAAgWB1UCJBhrn9CvLU0+vEFRIMizj0dxarD4x4kYA0cJVpMK8MZYTQefVFCGTcq8uh/65C+AN+SCoNEvkZzkZK8KgB6BDDsTvgc8rrCOAAne+24/IuSzzq+1tOO3VruyFZWyduC+98S0XGl80a8l5WjtCBUz9vvxzrLNZ3rPjpgtAosREo9MSaANxSQZy8MKY1V48I1DEs/mj5RKmjHaXnsm0TtIOQUlQYC0Y3wGSJ01EQtsSpUdhwHkIgGscY0M8FrxfOGp1au8AI2IHjeDN32LztDsP2KcySGXYlHfWppBKObEhoBk8H/EkrIxTuwsdAPFFiID/mcG+W2+2ZpF44bCBoMpF1p04ysATEznZqnWDV1cLSTdzwXPHGRRQhESM+REc1BSlMr2lDfI8m6duj3ogBfm7YXJIVogN8IZSsFviWQ1sOxa7MplRpJrf+f82JCnMAsf/JiXvSu+Uwesoic3IAGQYe34AxvMKKlyIZaa8MkBBtoEP3daiMwNdGaySx3pBP4GQEYrRcE=
file:
- release/cast-linux-386
- release/cast-linux-amd64
- release/cast-linux-arm
- release/cast-mac-amd64
- release/cast-windows-386.exe
- release/cast-windows-amd64.exe
on:
repo: barnybug/go-cast
tags: true
- make test
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ release:
GOOS=windows GOARCH=amd64 go build $(buildargs) -o release/cast-windows-amd64.exe $(exe)
goupx release/cast-linux-amd64
upx release/cast-linux-386 release/cast-linux-arm release/cast-windows-386.exe

upx:
goupx dist/cast-linux-amd64/cast-linux-amd64
upx dist/cast-linux-386/cast-linux-386 dist/cast-linux-arm/cast-linux-arm dist/cast-windows-386/cast-windows-386.exe

0 comments on commit b31acbf

Please sign in to comment.