Skip to content

Commit ed1d95c

Browse files
use go1.18 to build gitea (#19099)
* 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
1 parent fe9626a commit ed1d95c

10 files changed

+259
-63
lines changed

.drone.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
- make deps-frontend
2626

2727
- name: deps-backend
28-
image: golang:1.17
28+
image: golang:1.18
2929
pull: always
3030
commands:
3131
- make deps-backend
@@ -88,7 +88,7 @@ steps:
8888
depends_on: [deps-frontend]
8989

9090
- name: checks-backend
91-
image: golang:1.17
91+
image: golang:1.18
9292
commands:
9393
- make checks-backend
9494
depends_on: [deps-backend]
@@ -122,7 +122,7 @@ steps:
122122
path: /go
123123

124124
- name: build-backend-arm64
125-
image: golang:1.17
125+
image: golang:1.18
126126
environment:
127127
GO111MODULE: on
128128
GOPROXY: https://goproxy.cn
@@ -138,7 +138,7 @@ steps:
138138
path: /go
139139

140140
- name: build-backend-windows
141-
image: golang:1.17
141+
image: golang:1.18
142142
environment:
143143
GO111MODULE: on
144144
GOPROXY: https://goproxy.cn
@@ -153,7 +153,7 @@ steps:
153153
path: /go
154154

155155
- name: build-backend-386
156-
image: golang:1.17
156+
image: golang:1.18
157157
environment:
158158
GO111MODULE: on
159159
GOPROXY: https://goproxy.cn
@@ -242,7 +242,7 @@ steps:
242242
- pull_request
243243

244244
- name: deps-backend
245-
image: golang:1.17
245+
image: golang:1.18
246246
pull: always
247247
commands:
248248
- make deps-backend
@@ -359,7 +359,7 @@ steps:
359359
path: /go
360360

361361
- name: generate-coverage
362-
image: golang:1.17
362+
image: golang:1.18
363363
commands:
364364
- make coverage
365365
environment:
@@ -434,7 +434,7 @@ steps:
434434
- pull_request
435435

436436
- name: deps-backend
437-
image: golang:1.17
437+
image: golang:1.18
438438
pull: always
439439
commands:
440440
- make deps-backend
@@ -576,7 +576,7 @@ trigger:
576576

577577
steps:
578578
- name: download
579-
image: golang:1.17
579+
image: golang:1.18
580580
pull: always
581581
commands:
582582
- timeout -s ABRT 40m make generate-license generate-gitignore
@@ -637,7 +637,7 @@ steps:
637637
- make deps-frontend
638638

639639
- name: deps-backend
640-
image: golang:1.17
640+
image: golang:1.18
641641
pull: always
642642
commands:
643643
- make deps-backend
@@ -646,7 +646,7 @@ steps:
646646
path: /go
647647

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

757757
- name: deps-backend
758-
image: golang:1.17
758+
image: golang:1.18
759759
pull: always
760760
commands:
761761
- make deps-backend
@@ -764,7 +764,7 @@ steps:
764764
path: /go
765765

766766
- name: static
767-
image: techknowlogick/xgo:go-1.17.x
767+
image: techknowlogick/xgo:go-1.18.x
768768
pull: always
769769
commands:
770770
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs

.golangci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ linters:
1313
#- gocyclo # The cyclomatic complexety of a lot of functions is too high, we should refactor those another time.
1414
- gofmt
1515
- misspell
16-
- gocritic
16+
#- gocritic # TODO: disabled until fixed with go 1.18
1717
- bidichk
1818
- ineffassign
1919
- revive
@@ -64,7 +64,7 @@ linters-settings:
6464
- name: modifies-value-receiver
6565
gofumpt:
6666
extra-rules: true
67-
lang-version: 1.17
67+
lang-version: 1.18
6868

6969
issues:
7070
exclude-rules:
@@ -152,3 +152,5 @@ issues:
152152
- path: models/user/openid.go
153153
linters:
154154
- golint
155+
- linters: staticcheck
156+
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."

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.17-alpine3.15 AS build-env
2+
FROM golang:1.18-alpine3.15 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Build stage
2-
FROM golang:1.17-alpine3.15 AS build-env
2+
FROM golang:1.18-alpine3.15 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ SHASUM ?= shasum -a 256
2424
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
2525
COMMA := ,
2626

27-
XGO_VERSION := go-1.17.x
27+
XGO_VERSION := go-1.18.x
2828
MIN_GO_VERSION := 001017000
2929
MIN_NODE_VERSION := 012017000
3030

3131
AIR_PACKAGE ?= github.com/cosmtrek/air@bedc18201271882c2be66d216d0e1a275b526ec4
3232
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@50adf46752da119dfef66e57be3ce2693ea4aa9c
3333
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@8ddee489636a8311a376fc92e27a6a13c6658344
3434
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
35-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected].0
35+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/[email protected].2
3636
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3737
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/[email protected]
3838
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ or if SQLite support is required:
7373

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

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

7979
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.

docs/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ params:
2020
website: https://docs.gitea.io
2121
version: 1.16.4
2222
minGoVersion: 1.17
23-
goVersion: 1.17
23+
goVersion: 1.18
2424
minNodeVersion: 12.17
2525

2626
outputs:

0 commit comments

Comments
 (0)