forked from perrornet/miner-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
12 lines (11 loc) · 1.14 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
gitCommit=$(git show -s --format=%s)
version=$(git describe --abbrev=0 --tags)
cd ./cmd/miner-proxy/
echo "start build git commit $gitCommit version $version"
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -ldflags "-s -w -extldflags '-static' -X 'main.version=${version}' -X 'main.gitCommit=${gitCommit}'" -o ../../miner-proxy_darwin_amd64 .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags "-s -w -extldflags '-static' -X 'main.version=${version}' -X 'main.gitCommit=${gitCommit}'" -o ../../miner-proxy_linux_amd64 .
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -a -ldflags "-s -w -extldflags '-static' -X 'main.version=${version}' -X 'main.gitCommit=${gitCommit}'" -o ../../miner-proxy_linux_arm .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -ldflags "-s -w -extldflags '-static' -X 'main.version=${version}' -X 'main.gitCommit=${gitCommit}'" -o ../../miner-proxy_windows_amd64.exe .
CGO_ENABLED=0 GOOS=windows GOARCH=arm go build -a -ldflags "-s -w -extldflags '-static' -X 'main.version=${version}' -X 'main.gitCommit=${gitCommit}'" -o ../../miner-proxy_windows_arm.exe .
echo "build success"
cd ../../ && ls | grep "miner-proxy"