Skip to content

Commit

Permalink
go 1.14 (#10467)
Browse files Browse the repository at this point in the history
  • Loading branch information
techknowlogick committed Mar 20, 2020
1 parent e5a008f commit 2fa1078
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 34 deletions.
28 changes: 14 additions & 14 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:

- name: build-without-gcc
pull: always
image: golang:1.11 # this step is kept as the lowest version of golang that we support
image: golang:1.12 # this step is kept as the lowest version of golang that we support
environment:
GO111MODULE: on
GOPROXY: off
Expand All @@ -28,7 +28,7 @@ steps:

- name: build-linux-386
pull: always
image: golang:1.13
image: golang:1.14
environment:
GO111MODULE: on
GOPROXY: off
Expand All @@ -39,7 +39,7 @@ steps:

- name: check
pull: always
image: golang:1.13
image: golang:1.14
commands:
- make clean golangci-lint revive swagger-check swagger-validate test-vendor
environment:
Expand Down Expand Up @@ -105,7 +105,7 @@ steps:

- name: build
pull: always
image: golang:1.13
image: golang:1.14
commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build
Expand All @@ -122,7 +122,7 @@ steps:

- name: unit-test
pull: always
image: golang:1.13
image: golang:1.14
commands:
- make unit-test-coverage test-check
environment:
Expand All @@ -133,7 +133,7 @@ steps:

- name: test-mysql
pull: always
image: golang:1.13
image: golang:1.14
commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs
Expand All @@ -147,7 +147,7 @@ steps:

- name: test-mysql8
pull: always
image: golang:1.13
image: golang:1.14
commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs
Expand All @@ -161,7 +161,7 @@ steps:

- name: test-mssql
pull: always
image: golang:1.13
image: golang:1.14
commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs
Expand All @@ -175,7 +175,7 @@ steps:

- name: generate-coverage
pull: always
image: golang:1.13
image: golang:1.14
commands:
- make coverage
environment:
Expand Down Expand Up @@ -248,7 +248,7 @@ steps:

- name: build
pull: always
image: golang:1.13
image: golang:1.14
commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build
Expand All @@ -259,7 +259,7 @@ steps:

- name: test-sqlite
pull: always
image: golang:1.13
image: golang:1.14
commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs
Expand All @@ -272,7 +272,7 @@ steps:

- name: test-pgsql
pull: always
image: golang:1.13
image: golang:1.14
commands:
- "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash"
- apt-get install -y git-lfs
Expand Down Expand Up @@ -379,7 +379,7 @@ steps:

- name: static
pull: always
image: techknowlogick/xgo:go-1.13.x
image: techknowlogick/xgo:go-1.14.x
commands:
- apt update && apt -y install curl
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
Expand Down Expand Up @@ -477,7 +477,7 @@ steps:

- name: static
pull: always
image: techknowlogick/xgo:go-1.13.x
image: techknowlogick/xgo:go-1.14.x
commands:
- apt update && apt -y install curl
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

###################################
#Build stage
FROM golang:1.13-alpine3.11 AS build-env
FROM golang:1.14-alpine3.11 AS build-env

ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
Expand Down
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ SHASUM ?= shasum -a 256
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
COMMA := ,

XGO_VERSION := go-1.14.x
MIN_GO_VERSION := 001012000
MIN_NODE_VERSION := 010000000

ifeq ($(HAS_GO), GO)
GOPATH ?= $(shell $(GO) env GOPATH)
export PATH := $(GOPATH)/bin:$(PATH)
Expand Down Expand Up @@ -145,8 +149,8 @@ help:
.PHONY: go-check
go-check:
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');))
@if [ "$(GO_VERSION)" -lt "001011000" ]; then \
echo "Gitea requires Go 1.11 or greater to build. You can get it at https://golang.org/dl/"; \
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
echo "Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/"; \
exit 1; \
fi

Expand All @@ -161,7 +165,7 @@ git-check:
node-check:
$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');))
$(eval NPM_MISSING := $(shell hash npm > /dev/null 2>&1 || echo 1))
@if [ "$(NODE_VERSION)" -lt "010000000" -o "$(NPM_MISSING)" = "1" ]; then \
@if [ "$(NODE_VERSION)" -lt "$(MIN_NODE_VERSION)" -o "$(NPM_MISSING)" = "1" ]; then \
echo "Gitea requires Node.js 10 or greater and npm to build. You can get it at https://nodejs.org/en/download/"; \
exit 1; \
fi
Expand Down Expand Up @@ -480,7 +484,7 @@ release-windows: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'windows/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries
endif
Expand All @@ -490,7 +494,7 @@ release-linux: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '-linkmode external -extldflags "-static" $(LDFLAGS)' -targets 'linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/mips64le,linux/mips,linux/mipsle' -out gitea-$(VERSION) .
ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries
endif
Expand All @@ -500,7 +504,7 @@ release-darwin: | $(DIST_DIRS)
@hash xgo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u src.techknowlogick.com/xgo; \
fi
xgo -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
xgo -go $(XGO_VERSION) -dest $(DIST)/binaries -tags 'netgo osusergo $(TAGS)' -ldflags '$(LDFLAGS)' -targets 'darwin/*' -out gitea-$(VERSION) .
ifeq ($(CI),drone)
cp /build/* $(DIST)/binaries
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ or if sqlite support is required:

The `build` target is split into two sub-targets:

- `make backend` which requires [Go 1.11](https://golang.org/dl/) or greater.
- `make backend` which requires [Go 1.12](https://golang.org/dl/) or greater.
- `make frontend` which requires [Node.js 10](https://nodejs.org/en/download/) or greater.

If pre-built frontend files are present it is possible to only build the backend:
Expand Down
4 changes: 2 additions & 2 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ params:
author: The Gitea Authors
website: https://docs.gitea.io
version: 1.11.3
minGoVersion: 1.11
goVersion: 1.13
minGoVersion: 1.12
goVersion: 1.14
minNodeVersion: 10

outputs:
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module code.gitea.io/gitea

go 1.13
go 1.14

require (
cloud.google.com/go v0.45.0 // indirect
Expand Down Expand Up @@ -50,6 +50,7 @@ require (
github.com/gobwas/glob v0.2.3
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
github.com/golang/protobuf v1.3.4 // indirect
github.com/google/go-github/v24 v24.0.1
github.com/gorilla/context v1.1.1
github.com/huandu/xstrings v1.3.0
Expand Down Expand Up @@ -91,6 +92,7 @@ require (
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
github.com/stretchr/testify v1.4.0
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
github.com/tinylib/msgp v1.1.1 // indirect
github.com/tstranex/u2f v1.0.0
github.com/unknwon/cae v1.0.0
github.com/unknwon/com v1.0.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
Expand Down Expand Up @@ -553,6 +555,8 @@ github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.1 h1:TnCZ3FIuKeaIy+F45+Cnp+caqdXGy4z74HvwXN+570Y=
github.com/tinylib/msgp v1.1.1/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/toqueteos/trie v1.0.0 h1:8i6pXxNUXNRAqP246iibb7w/pSFquNTQ+uNfriG7vlk=
github.com/toqueteos/trie v1.0.0/go.mod h1:Ywk48QhEqhU1+DwhMkJ2x7eeGxDHiGkAdc9+0DYcbsM=
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/golang/protobuf/proto/lib.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions vendor/github.com/golang/protobuf/proto/text.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/tinylib/msgp/msgp/extension.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/tinylib/msgp/msgp/read_bytes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2fa1078

Please sign in to comment.