Skip to content

Commit 87bb554

Browse files
authored
Merge pull request #91 from adamdecaf/windows-releases
build: release windows binary
2 parents 4d037b6 + 31e5a85 commit 87bb554

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.travis.yml

+13-9
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,50 @@ matrix:
1515
cache:
1616
directories:
1717
- "/Users/travis/Library/Caches/go-build"
18+
- os: windows
19+
go: 1.14.x
1820
before_install:
1921
# Setup directory for binaries
2022
- mkdir ./bin
2123
- export PATH=$PATH:$PWD/bin
2224
# Misspell
2325
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O misspell.tar.gz https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz; fi
2426
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O misspell.tar.gz https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_mac_64bit.tar.gz; fi
25-
- tar xf misspell.tar.gz && cp ./misspell ./bin/misspell
27+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then tar xf misspell.tar.gz && cp ./misspell ./bin/misspell; fi
2628
# staticcheck
2729
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O staticcheck.tar.gz https://github.com/dominikh/go-tools/releases/download/2020.1.3/staticcheck_linux_amd64.tar.gz; fi
2830
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O staticcheck.tar.gz https://github.com/dominikh/go-tools/releases/download/2020.1.3/staticcheck_darwin_amd64.tar.gz; fi
29-
- tar xf staticcheck.tar.gz && cp ./staticcheck/staticcheck ./bin/staticcheck
31+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then tar xf staticcheck.tar.gz && cp ./staticcheck/staticcheck ./bin/staticcheck; fi
3032
# nancy (vulnerable dependencies)
3133
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl -L -o ./bin/nancy https://github.com/sonatype-nexus-community/nancy/releases/download/v0.1.0/nancy-linux.amd64-v0.1.0; fi
3234
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -L -o ./bin/nancy https://github.com/sonatype-nexus-community/nancy/releases/download/v0.1.0/nancy-darwin.amd64-v0.1.0; fi
3335
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then chmod +x ./bin/nancy; fi
3436
# golint
35-
- go get -u golang.org/x/lint/golint
37+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then go get -u golang.org/x/lint/golint; fi
3638
# gocyclo
3739
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget -O ./bin/gocyclo https://github.com/adamdecaf/gocyclo/releases/download/2019-08-09/gocyclo-linux-amd64; fi
3840
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -O ./bin/gocyclo https://github.com/adamdecaf/gocyclo/releases/download/2019-08-09/gocyclo-darwin-amd64; fi
39-
- chmod +x ./bin/gocyclo
41+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then chmod +x ./bin/gocyclo; fi
4042
before_script:
4143
- GOFILES=$(find . -type f -name '*.go' | grep -v vendor | grep -v client)
4244
- go mod graph
4345
script:
4446
# Just check gofmt on linux, it's the fastest builder
4547
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then test -z $(gofmt -s -l $GOFILES); fi
4648
- go test ./... -race -coverprofile=coverage.txt -covermode=atomic
47-
- misspell -error -locale US $GOFILES
48-
- gocyclo -over 25 $GOFILES
49-
- golint -set_exit_status $GOFILES
50-
- staticcheck . ./cmd/... ./pkg/...
49+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then misspell -error -locale US $GOFILES; fi
50+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then gocyclo -over 25 $GOFILES; fi
51+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then golint -set_exit_status $GOFILES; fi
52+
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then staticcheck . ./cmd/... ./pkg/...; fi
5153
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then go list -m all | ./bin/nancy; fi
5254
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make && make docker && make test-integration; fi
5355
after_success:
5456
- bash <(curl -s https://codecov.io/bash) -X fix
5557
- make
5658
- make client
57-
- make docker
59+
- if [[ "$TRAVIS_OS_NAME" != "linux" ]]; then make docker; fi
5860
before_deploy:
61+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y make; fi
5962
- make dist
6063
deploy:
6164
provider: releases
@@ -64,6 +67,7 @@ deploy:
6467
file_glob: true
6568
file:
6669
- bin/fed-*
70+
- bin/fed.exe
6771
on:
6872
repo: moov-io/fed
6973
tags: true

makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ clean:
3131

3232
dist: clean client build
3333
ifeq ($(OS),Windows_NT)
34-
CGO_ENABLED=1 GOOS=windows go build -o bin/fed-windows-amd64.exe github.com/moov-io/fed/cmd/server
34+
CGO_ENABLED=1 GOOS=windows go build -o bin/fed.exe github.com/moov-io/fed/cmd/server
3535
else
3636
CGO_ENABLED=1 GOOS=$(PLATFORM) go build -o bin/fed-$(PLATFORM)-amd64 github.com/moov-io/fed/cmd/server
3737
endif

0 commit comments

Comments
 (0)