[chore] Update Go version to 1.18 (#444)

* linting with new golangci-lint version

* update go to 1.18

* bump versions in drone.yml

* use new runtime/debug package for version info

* remove Commit build flag from goreleaser

* remove mock commit + version from build script

* go fmt

* add dummy version env flag to test container

* install git in golang container for testing

* only set versionString if Version is defined
This commit is contained in:
tobi 2022-04-02 15:40:09 +02:00 committed by GitHub
commit 03d7c75ebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 87 additions and 246 deletions

View file

@ -12,7 +12,7 @@ steps:
# We use golangci-lint for linting.
# See: https://golangci-lint.run/
- name: lint
image: golangci/golangci-lint:v1.43.0
image: golangci/golangci-lint:v1.45.2
volumes:
- name: go-build-cache
path: /root/.cache/go-build
@ -28,13 +28,14 @@ steps:
- pull_request
- name: test
image: golang:1.17.7-alpine3.14
image: golang:1.18-alpine
volumes:
- name: go-build-cache
path: /root/.cache/go-build
- name: go-src
path: /go
commands:
- apk update --no-cache && apk add git
- CGO_ENABLED=0 GTS_DB_TYPE="sqlite" GTS_DB_ADDRESS=":memory:" go test ./...
- CGO_ENABLED=0 ./test/cliparsing.sh
when:
@ -43,7 +44,7 @@ steps:
- pull_request
- name: snapshot
image: superseriousbusiness/gotosocial-drone-build:0.0.3 # https://github.com/superseriousbusiness/gotosocial-drone-build
image: superseriousbusiness/gotosocial-drone-build:0.0.4 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
@ -72,7 +73,7 @@ steps:
- main
- name: release
image: superseriousbusiness/gotosocial-drone-build:0.0.3 # https://github.com/superseriousbusiness/gotosocial-drone-build
image: superseriousbusiness/gotosocial-drone-build:0.0.4 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes:
- name: go-build-cache
path: /root/.cache/go-build
@ -131,24 +132,19 @@ clone:
steps:
- name: mirror
image: alpine/git
image: superseriousbusiness/gotosocial-drone-build:0.0.4
environment:
ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial
TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial
CODEBERG_USER: gotosocialbot
CODEBERG_EMAIL: admin@gotosocial.org
CODEBERG_TOKEN:
from_secret: gts_codeberg_token
commands:
# clone mirror
- git clone --mirror https://github.com/superseriousbusiness/gotosocial .
# configure git credentials
- git config --global user.email "admin@gotosocial.org"
- git config credential.helper store
- printf "https://gotosocialbot:${CODEBERG_TOKEN}@codeberg.org\n" >> ~/.git-credentials
# push mirror
- git push --mirror https://codeberg.org/superseriousbusiness/gotosocial
# clean up
- rm ~/.git-credentials
- /go/codeberg_clone.sh
---
kind: signature
hmac: 40ac973022e4bf7354a30b66ab660c4528be2667d98ff6e859386bfa24fa5dae
hmac: f3cf4e422d9ce7dc0a881da429db628232e2f9e91383ee5a33cf4f13542c0a23
...