diff --git a/contrib/release.sh b/contrib/release.sh index 189606ab23c..8d7c9805bfe 100755 --- a/contrib/release.sh +++ b/contrib/release.sh @@ -74,6 +74,7 @@ go get -u github.com/dgraph-io/dgo go get -u github.com/dgraph-io/badger go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/gogo/protobuf/protoc-gen-gofast +go get -u src.techknowlogick.com/xgo pushd $GOPATH/src/google.golang.org/grpc git checkout v1.13.0 @@ -119,50 +120,43 @@ popd # Build Windows. pushd $basedir/dgraph/dgraph - env GOOS=windows GOARCH=amd64 go get -v -d . - env GOOS=windows GOARCH=amd64 GO111MODULE=on go build -v -o dgraph-windows-amd64.exe -ldflags \ + xgo -go="go-$GOVERSION" --targets=windows/amd64 -ldflags \ "-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" . mkdir $TMP/windows - mv dgraph-windows-amd64.exe $TMP/windows/dgraph.exe + mv dgraph-windows-4.0-amd64.exe $TMP/windows/dgraph.exe popd pushd $basedir/badger/badger - env GOOS=windows GOARCH=amd64 go get -v -d . - env GOOS=windows GOARCH=amd64 GO111MODULE=on go build -v -o badger-windows-amd64.exe . - mv badger-windows-amd64.exe $TMP/windows/badger.exe + xgo -go="go-$GOVERSION" --targets=windows/amd64 . + mv badger-windows-4.0-amd64.exe $TMP/windows/badger.exe popd pushd $basedir/ratel - env GOOS=windows GOARCH=amd64 go get -v -d . - env GOOS=windows GOARCH=amd64 go build -v -o ratel-windows-amd64.exe -ldflags "-X $ratel_release=$release_version" . - mv ratel-windows-amd64.exe $TMP/windows/dgraph-ratel.exe + xgo -go="go-$GOVERSION" --targets=windows/amd64 -ldflags "-X $ratel_release=$release_version" . + mv ratel-windows-4.0-amd64.exe $TMP/windows/dgraph-ratel.exe popd # Build Darwin. pushd $basedir/dgraph/dgraph - env GOOS=darwin GOARCH=amd64 go get -v -d . - env GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -v -o dgraph-darwin-amd64 -ldflags \ - "-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" . + xgo -go="go-$GOVERSION" --targets=darwin-10.9/amd64 -ldflags \ + "-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" . mkdir $TMP/darwin - mv dgraph-darwin-amd64 $TMP/darwin/dgraph + mv dgraph-darwin-10.9-amd64 $TMP/darwin/dgraph popd pushd $basedir/badger/badger - env GOOS=darwin GOARCH=amd64 go get -v -d . - env GOOS=darwin GOARCH=amd64 GO111MODULE=on go build -v -o badger-darwin-amd64 . - mv badger-darwin-amd64 $TMP/darwin/badger + xgo -go="go-$GOVERSION" --targets=darwin-10.9/amd64 . + mv badger-darwin-10.9-amd64 $TMP/darwin/badger popd pushd $basedir/ratel - env GOOS=darwin GOARCH=amd64 go get -v -d . - env GOOS=darwin GOARCH=amd64 go build -v -o ratel-darwin-amd64 -v -ldflags "-X $ratel_release=$release_version" . - mv ratel-darwin-amd64 $TMP/darwin/dgraph-ratel + xgo -go="go-$GOVERSION" --targets=darwin-10.9/amd64 -ldflags "-X $ratel_release=$release_version" . + mv ratel-darwin-10.9-amd64 $TMP/darwin/dgraph-ratel popd # Build Linux. pushd $basedir/dgraph/dgraph - env GOOS=linux GOARCH=amd64 go get -v -d . - env GOOS=linux GOARCH=amd64 GO111MODULE=on go build -v -o dgraph-linux-amd64 -ldflags \ + xgo -go="go-$GOVERSION" --targets=linux/amd64 -ldflags \ "-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" . strip -x dgraph-linux-amd64 mkdir $TMP/linux @@ -170,15 +164,13 @@ pushd $basedir/dgraph/dgraph popd pushd $basedir/badger/badger - env GOOS=linux GOARCH=amd64 go get -v -d . - env GOOS=linux GOARCH=amd64 GO111MODULE=on go build -v -o badger-linux-amd64 . + xgo -go="go-$GOVERSION" --targets=linux/amd64 . strip -x badger-linux-amd64 mv badger-linux-amd64 $TMP/linux/badger popd pushd $basedir/ratel - env GOOS=linux GOARCH=amd64 go get -v -d . - env GOOS=linux GOARCH=amd64 go build -v -o ratel-linux-amd64 -ldflags "-X $ratel_release=$release_version" . + xgo -go="go-$GOVERSION" --targets=linux/amd64 -ldflags "-X $ratel_release=$release_version" . strip -x ratel-linux-amd64 mv ratel-linux-amd64 $TMP/linux/dgraph-ratel popd