Skip to content

Commit

Permalink
use go1.18 to build gitea (go-gitea#19099)
Browse files Browse the repository at this point in the history
* use go1.18 to build gitea& update min go version to 1.17

* bump in a few more places

* add a few simple tests for isipprivate

* update go.mod

* update URL to https://go.dev/dl/

* golangci-lint

* attempt golangci-lint workaround

* change version

* bump fumpt version

* skip strings.title test

* go mod tidy

* update tests as some aren't private??

* update tests
  • Loading branch information
techknowlogick authored and Stelios Malathouras committed Mar 28, 2022
1 parent 05d6fa9 commit 7b371eb
Show file tree
Hide file tree
Showing 10 changed files with 259 additions and 63 deletions.
26 changes: 13 additions & 13 deletions .drone.yml
Expand Up @@ -25,7 +25,7 @@ steps:
- make deps-frontend

- name: deps-backend
image: golang:1.17
image: golang:1.18
pull: always
commands:
- make deps-backend
Expand Down Expand Up @@ -88,7 +88,7 @@ steps:
depends_on: [deps-frontend]

- name: checks-backend
image: golang:1.17
image: golang:1.18
commands:
- make checks-backend
depends_on: [deps-backend]
Expand Down Expand Up @@ -122,7 +122,7 @@ steps:
path: /go

- name: build-backend-arm64
image: golang:1.17
image: golang:1.18
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
Expand All @@ -138,7 +138,7 @@ steps:
path: /go

- name: build-backend-windows
image: golang:1.17
image: golang:1.18
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
Expand All @@ -153,7 +153,7 @@ steps:
path: /go

- name: build-backend-386
image: golang:1.17
image: golang:1.18
environment:
GO111MODULE: on
GOPROXY: https://goproxy.cn
Expand Down Expand Up @@ -242,7 +242,7 @@ steps:
- pull_request

- name: deps-backend
image: golang:1.17
image: golang:1.18
pull: always
commands:
- make deps-backend
Expand Down Expand Up @@ -359,7 +359,7 @@ steps:
path: /go

- name: generate-coverage
image: golang:1.17
image: golang:1.18
commands:
- make coverage
environment:
Expand Down Expand Up @@ -434,7 +434,7 @@ steps:
- pull_request

- name: deps-backend
image: golang:1.17
image: golang:1.18
pull: always
commands:
- make deps-backend
Expand Down Expand Up @@ -576,7 +576,7 @@ trigger:

steps:
- name: download
image: golang:1.17
image: golang:1.18
pull: always
commands:
- timeout -s ABRT 40m make generate-license generate-gitignore
Expand Down Expand Up @@ -637,7 +637,7 @@ steps:
- make deps-frontend

- name: deps-backend
image: golang:1.17
image: golang:1.18
pull: always
commands:
- make deps-backend
Expand All @@ -646,7 +646,7 @@ steps:
path: /go

- name: static
image: techknowlogick/xgo:go-1.17.x
image: techknowlogick/xgo:go-1.18.x
pull: always
commands:
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
Expand Down Expand Up @@ -755,7 +755,7 @@ steps:
- make deps-frontend

- name: deps-backend
image: golang:1.17
image: golang:1.18
pull: always
commands:
- make deps-backend
Expand All @@ -764,7 +764,7 @@ steps:
path: /go

- name: static
image: techknowlogick/xgo:go-1.17.x
image: techknowlogick/xgo:go-1.18.x
pull: always
commands:
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
Expand Down
6 changes: 4 additions & 2 deletions .golangci.yml
Expand Up @@ -13,7 +13,7 @@ linters:
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
- gofmt
- misspell
- gocritic
#- gocritic # TODO: disabled until fixed with go 1.18
- bidichk
- ineffassign
- revive
Expand Down Expand Up @@ -64,7 +64,7 @@ linters-settings:
- name: modifies-value-receiver
gofumpt:
extra-rules: true
lang-version: 1.17
lang-version: 1.18

issues:
exclude-rules:
Expand Down Expand Up @@ -152,3 +152,5 @@ issues:
- path: models/user/openid.go
linters:
- golint
- linters: staticcheck
text: "strings.Title is deprecated: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead."
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,5 +1,5 @@
#Build stage
FROM golang:1.17-alpine3.15 AS build-env
FROM golang:1.18-alpine3.15 AS build-env

ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.rootless
@@ -1,5 +1,5 @@
#Build stage
FROM golang:1.17-alpine3.15 AS build-env
FROM golang:1.18-alpine3.15 AS build-env

ARG GOPROXY
ENV GOPROXY ${GOPROXY:-direct}
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -24,15 +24,15 @@ SHASUM ?= shasum -a 256
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
COMMA := ,

XGO_VERSION := go-1.17.x
XGO_VERSION := go-1.18.x
MIN_GO_VERSION := 001017000
MIN_NODE_VERSION := 012017000

AIR_PACKAGE ?= github.com/cosmtrek/air@bedc18201271882c2be66d216d0e1a275b526ec4
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@50adf46752da119dfef66e57be3ce2693ea4aa9c
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@8ddee489636a8311a376fc92e27a6a13c6658344
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.27.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -73,7 +73,7 @@ or if SQLite support is required:

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

- `make backend` which requires [Go 1.17](https://golang.org/dl/) or greater.
- `make backend` which requires [Go 1.17](https://go.dev/dl/) or greater.
- `make frontend` which requires [Node.js LTS](https://nodejs.org/en/download/) or greater and Internet connectivity to download npm dependencies.

When building from the official source tarballs which include pre-built frontend files, the `frontend` target will not be triggered, making it possible to build without Node.js and Internet connectivity.
Expand Down
2 changes: 1 addition & 1 deletion docs/config.yaml
Expand Up @@ -20,7 +20,7 @@ params:
website: https://docs.gitea.io
version: 1.16.4
minGoVersion: 1.17
goVersion: 1.17
goVersion: 1.18
minNodeVersion: 12.17

outputs:
Expand Down

0 comments on commit 7b371eb

Please sign in to comment.