Add GO111MODULE=off to build.sh, use Golang 1.16 (#966)
* Add GO111MODULE=off to build.sh * Use golang 1.16 * Update go version in README.md * Add missing GO111MODULE=off * Add missing GO111MODULE=off again * Use go1.16.3 explicitly * Use 1.16 for CI test * Update min go version * Use go 1.16.4
This commit is contained in:
parent
36c669dd75
commit
8f42dedef8
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Go 1.15
|
||||
- name: Set up Go 1.16
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.15
|
||||
go-version: 1.16
|
||||
|
||||
- name: Build
|
||||
run: script/cibuild
|
||||
|
4
.github/workflows/replica-tests.yml
vendored
4
.github/workflows/replica-tests.yml
vendored
@ -13,10 +13,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Go 1.14
|
||||
- name: Set up Go 1.16
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.14
|
||||
go-version: 1.16
|
||||
|
||||
- name: migration tests
|
||||
env:
|
||||
|
@ -1,6 +1,4 @@
|
||||
#
|
||||
|
||||
FROM golang:1.15.6
|
||||
FROM golang:1.16.4
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y ruby ruby-dev rubygems build-essential
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM golang:1.15.6
|
||||
FROM golang:1.16.4
|
||||
LABEL maintainer="github@github.com"
|
||||
|
||||
RUN apt-get update
|
||||
|
@ -95,7 +95,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d
|
||||
|
||||
[Download latest release here](https://github.com/github/gh-ost/releases/latest)
|
||||
|
||||
`gh-ost` is a Go project; it is built with Go `1.14` and above. To build on your own, use either:
|
||||
`gh-ost` is a Go project; it is built with Go `1.15` and above. To build on your own, use either:
|
||||
- [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary.
|
||||
- [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost`
|
||||
|
||||
|
7
build.sh
7
build.sh
@ -18,15 +18,16 @@ function build {
|
||||
GOOS=$3
|
||||
GOARCH=$4
|
||||
|
||||
if ! go version | egrep -q 'go(1\.1[456])' ; then
|
||||
echo "go version must be 1.14 or above"
|
||||
if ! go version | egrep -q 'go(1\.1[56])' ; then
|
||||
echo "go version must be 1.15 or above"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO: remove GO111MODULE once gh-ost uses Go modules
|
||||
echo "Building ${osname} binary"
|
||||
export GOOS
|
||||
export GOARCH
|
||||
go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
|
||||
GO111MODULE=off go build -ldflags "$ldflags" -o $buildpath/$target go/cmd/gh-ost/main.go
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Build failed for ${osname}"
|
||||
|
@ -242,7 +242,10 @@ build_binary() {
|
||||
echo "Using binary: $ghost_binary"
|
||||
return 0
|
||||
fi
|
||||
go build -o $ghost_binary go/cmd/gh-ost/main.go
|
||||
|
||||
# TODO: remove GO111MODULE once gh-ost uses Go modules
|
||||
GO111MODULE=off go build -o $ghost_binary go/cmd/gh-ost/main.go
|
||||
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "Build failure"
|
||||
exit 1
|
||||
|
@ -17,4 +17,5 @@ export GOPATH="$PWD/.gopath"
|
||||
cd .gopath/src/github.com/github/gh-ost
|
||||
|
||||
# We put the binaries directly into the bindir, because we have no need for shim wrappers
|
||||
go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go
|
||||
# TODO: remove GO111MODULE once gh-ost uses Go modules
|
||||
GO111MODULE=off go build -o "$bindir/gh-ost" -ldflags "-X main.AppVersion=${version} -X main.BuildDescribe=${describe}" ./go/cmd/gh-ost/main.go
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
PREFERRED_GO_VERSION=go1.14.7
|
||||
SUPPORTED_GO_VERSIONS='go1.1[456]'
|
||||
PREFERRED_GO_VERSION=go1.16.4
|
||||
SUPPORTED_GO_VERSIONS='go1.1[56]'
|
||||
|
||||
GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg
|
||||
GO_PKG_DARWIN_SHA=0f215de06019a054a3da46a0722989986c956d719c7a0a8fc38a5f3c216d6f6b
|
||||
|
@ -13,5 +13,6 @@ script/build
|
||||
|
||||
cd .gopath/src/github.com/github/gh-ost
|
||||
|
||||
# TODO: remove GO111MODULE once gh-ost uses Go modules
|
||||
echo "Running unit tests"
|
||||
go test ./go/...
|
||||
GO111MODULE=off go test ./go/...
|
||||
|
Loading…
Reference in New Issue
Block a user