Skip to content

Commit e295ff5

Browse files
committed
adds travis and goreleaser
1 parent 4b87fe6 commit e295ff5

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.goreleaser.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Build customization
2+
builds:
3+
-
4+
binary: "{{ .ProjectName }}"
5+
ldflags: -s -w -X main.appName={{ .ProjectName }} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.appVer={{.Tag}}
6+
goos:
7+
- windows
8+
- darwin
9+
- linux
10+
goarch:
11+
- amd64
12+
archive:
13+
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}"
14+
replacements:
15+
darwin: mac
16+
format: binary
17+
checksum:
18+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
19+
release:
20+
name_template: "{{.ProjectName}} v{{.Version}}"
21+
changelog:
22+
filters:
23+
exclude:
24+
- '[b|B]ump.*\sversion'
25+
- '.*typo.*'
26+
- '[V|v]ersion.*\sbump'

.travis.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .travis.yml
2+
language: go
3+
4+
# Only build tags
5+
if: tag IS present
6+
7+
env:
8+
- DEP_VERSION="0.5.0"
9+
10+
before_install:
11+
# Download the binary to bin folder in $GOPATH
12+
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
13+
# Make the binary executable
14+
- chmod +x $GOPATH/bin/dep
15+
16+
install:
17+
- dep ensure
18+
19+
# calls goreleaser
20+
deploy:
21+
- provider: script
22+
skip_cleanup: true
23+
script: curl -sL https://git.io/goreleaser | bash
24+
on:
25+
tags: true
26+
condition: $TRAVIS_OS_NAME = linux

0 commit comments

Comments
 (0)