From 0cceec29995550c715272e7c4087aa1536252527 Mon Sep 17 00:00:00 2001 From: bpicode Date: Sun, 22 Oct 2017 20:44:25 +0200 Subject: [PATCH] ci: let windows binary release have the file extension .exe --- .travis.yml | 4 ++-- hack/build-all.bash | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff197a23e7..4d3995772a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,8 +66,8 @@ jobs: - release/dep-linux-amd64.sha256 - release/dep-darwin-amd64 - release/dep-darwin-amd64.sha256 - - release/dep-windows-amd64 - - release/dep-windows-amd64.sha256 + - release/dep-windows-amd64.exe + - release/dep-windows-amd64.exe.sha256 skip_cleanup: true on: repo: golang/dep diff --git a/hack/build-all.bash b/hack/build-all.bash index 45f8cf2476..b696635b69 100755 --- a/hack/build-all.bash +++ b/hack/build-all.bash @@ -17,6 +17,9 @@ DATE=$(date "+%Y-%m-%d") GO_BUILD_CMD="go build -a -installsuffix cgo" GO_BUILD_LDFLAGS="-s -w -X main.commitHash=$COMMIT_HASH -X main.buildDate=$DATE -X main.version=$VERSION" +declare -A PLATFORM_FILE_EXTENSIONS +PLATFORM_FILE_EXTENSIONS["windows"]=.exe + if [ -z "$DEP_BUILD_PLATFORMS" ]; then DEP_BUILD_PLATFORMS="linux windows darwin" fi @@ -30,8 +33,9 @@ mkdir -p release for OS in ${DEP_BUILD_PLATFORMS[@]}; do for ARCH in ${DEP_BUILD_ARCHS[@]}; do echo "Building for $OS/$ARCH" + BINARY="dep-$OS-$ARCH${PLATFORM_FILE_EXTENSIONS[$OS]}" GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 $GO_BUILD_CMD -ldflags "$GO_BUILD_LDFLAGS"\ - -o "release/dep-$OS-$ARCH" ./cmd/dep/ - shasum -a 256 "release/dep-$OS-$ARCH" > "release/dep-$OS-$ARCH".sha256 + -o "release/${BINARY}" ./cmd/dep/ + shasum -a 256 "release/${BINARY}" > "release/${BINARY}".sha256 done done