Skip to content

Commit

Permalink
use shell to make release
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 20, 2018
1 parent de02e16 commit ec06d19
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

23 changes: 23 additions & 0 deletions make_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash


BIN=ydcv
GITVER=$(git rev-parse --short HEAD)

rm -fv ydcv_*

if [[ -e /proc/sys/kernel/osrelease ]] && grep -q -i microsoft /proc/sys/kernel/osrelease && command -v go.exe; then
# for WSL
for OS in darwin linux; do
env WSLENV=CGO_ENABLE:GOARCH:GOOS CGO_ENABLED=0 GOARCH=amd64 GOOS=$OS cmd.exe /C go.exe build -o ${BIN}_${OS} -ldflags "-s -w -X main.VERSION=$GITVER"
done
env WSLENV=CGO_ENABLE:GOARCH:GOOS CGO_ENABLED=0 GOARCH=amd64 GOOS=windows cmd.exe /C go.exe build -o ${BIN}_windows.exe -ldflags "-s -w -X main.VERSION=$GITVER"
else

# for normal unix env
for OS in darwin linux; do
CGO_ENABLED=0 GOARCH=amd64 GOOS=$OS go build -o ${BIN}_${OS} -ldflags "-s -w -X main.VERSION=$GITVER"
done
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o ${BIN}_windows.exe -ldflags "-s -w -X main.VERSION=$GITVER"
fi

0 comments on commit ec06d19

Please sign in to comment.