Skip to content

Commit

Permalink
Better building with travis please
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Shone committed Jan 9, 2019
1 parent a516421 commit 084a13e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.audiofile.db
build/
node_modules
dist
*log
Expand Down
13 changes: 6 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ language: go
go:
- 1.11.x
dist: xenial
cache:
npm: true
yarn: true
directories:
- node_modules
env:
global:
- GO111MODULE=on
Expand All @@ -23,16 +28,10 @@ before_script:
- ./cc-test-reporter before-build
jobs:
include:
- stage: compile
script: GOARCH=amd64 GOOS=linux go build -o build/audiofile.$GOARCH-$GOOS ./audiofile
- script: GOARCH=amd64 GOOS=darwin go build -o build/audiofile.$GOARCH-$GOOS ./audiofile
- script: GOARCH=amd64 GOOS=windows go build -o build/audiofile.$GOARCH-$GOOS ./audiofile
- script: GOARCH=386 GOOS=linux go build -o build/audiofile.$GOARCH-$GOOS ./audiofile
- script: GOARCH=386 GOOS=windows go build -o build/audiofile.$GOARCH-$GOOS ./audiofile
- stage: test
script: go test -coverprofile=./build/cover.tmp -covermode=atomic -race ./...
- stage: deploy
script: echo "Deploying to Github Releases"
script: make binaries
deploy:
provider: releases
api_key:
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ bin-migrations:
bin-dist:
go-bindata -o audiofile/assets.go -prefix dist/ dist/...

binaries:
$(MAKE) binary GOARCH=amd64 GOOS=linux
$(MAKE) binary GOARCH=amd64 GOOS=windows
$(MAKE) binary GOARCH=amd64 GOOS=darwin
$(MAKE) binary GOARCH=386 GOOS=linux
$(MAKE) binary GOARCH=386 GOOS=windows

binary: GOARCH?=amd64
binary: GOOS?=linux
binary:
go build -o build/audiofile.${GOARCH}-${GOOS} ./audiofile

# at this time, there's no watch enabled for the go binary
dev-be: bin-prep bin-migrations bin-dist install
audiofile
Expand Down

0 comments on commit 084a13e

Please sign in to comment.