Skip to content

Commit

Permalink
build: change to go1.20.7 to build
Browse files Browse the repository at this point in the history
  • Loading branch information
sinlov committed Aug 6, 2023
1 parent 2345553 commit 94dfb4f
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ steps:
- GOPATH
- GOBIN
- name: go-init
image: golang:1.18.10-buster
image: golang:1.20.7-bookworm
pull: if-not-exists
volumes:
- name: go_cache
Expand All @@ -50,7 +50,7 @@ steps:
depends_on: # https://docs.drone.io/pipeline/exec/syntax/parallelism/
- go-init

image: golang:1.18.10-buster
image: golang:1.20.7-bookworm
pull: if-not-exists
volumes:
- name: go_cache
Expand All @@ -68,7 +68,7 @@ steps:
depends_on: # https://docs.drone.io/pipeline/exec/syntax/parallelism/
- go-test

image: golang:1.18.10-buster
image: golang:1.20.7-bookworm
pull: if-not-exists
volumes:
- name: go_cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows-template/go-release-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go SDK
uses: actions/setup-go@v4
with:
go-version: '^1.18'
go-version: '^1.20'
cache: false
- name: Build Release binary
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows-template/golang-codecov.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
go:
- '^1.18'
- '^1.20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows-template/golang-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
go:
- '^1.18'
- '^1.20'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-release-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go SDK
uses: actions/setup-go@v4
with:
go-version: '^1.18'
go-version: '^1.20'
cache: false

- name: Build Release binary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-release-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Set up Go SDK
uses: actions/setup-go@v4
with:
go-version: '^1.18'
go-version: '^1.20'
cache: false

- name: Build Release binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
matrix:
go:
- '^1.18'
- '1.18.10'
- '^1.20'
- '1.20.7'
os:
- macos-latest
- windows-latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Author: convention-change
# dockerfile offical document https://docs.docker.com/engine/reference/builder/
# https://hub.docker.com/_/golang
FROM golang:1.18.10-buster as builder
FROM golang:1.20.7-bookworm as builder

ARG GO_ENV_PACKAGE_NAME=github.com/convention-change/drone-gitea-cc-release
ARG GO_ENV_ROOT_BUILD_BIN_NAME=drone-gitea-cc-release
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.s6
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Author: convention-change
# dockerfile offical document https://docs.docker.com/engine/reference/builder/
# https://hub.docker.com/_/golang
FROM golang:1.18.10-buster as builder
FROM golang:1.20.7-bookworm as builder

ARG GO_ENV_PACKAGE_NAME=github.com/convention-change/drone-gitea-cc-release
ARG GO_ENV_ROOT_BUILD_BIN_NAME=drone-gitea-cc-release
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ROOT_NAME?=drone-gitea-cc-release

## MakeDocker.mk settings start
ROOT_OWNER?=convention-change
ROOT_PARENT_SWITCH_TAG=1.18.10-buster
ROOT_PARENT_SWITCH_TAG=1.20.7-bookworm
# for image local build
INFO_TEST_BUILD_DOCKER_PARENT_IMAGE=golang
# for image running
Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

## for what

- drone CI release for [gitea](https://docs.gitea.com/) and support [conventional-commits](https://www.conventionalcommits.org/) log
- drone CI release for [gitea](https://docs.gitea.com/) and
support [conventional-commits](https://www.conventionalcommits.org/) log

## Contributing

Expand All @@ -37,7 +38,8 @@ Please read [Contributor Guide](.github/CONTRIBUTING_DOC/CONTRIBUTING.md) for mo
## usage

- [x] read [conventional-commits](https://www.conventionalcommits.org/) log
- [x] get your [gitea Access Token](https://docs.gitea.com/development/api-usage#authentication) for `release_gitea_api_key`
- [x] get your [gitea Access Token](https://docs.gitea.com/development/api-usage#authentication)
for `release_gitea_api_key`
- [x] add `.drone.yml` config as pipeline

### Pipeline Settings (.drone.yml)
Expand Down Expand Up @@ -110,9 +112,14 @@ steps:
```
- `1.x` drone-exec only support env
- download by [https://github.com/convention-change/drone-gitea-cc-release/releases](https://github.com/convention-change/drone-gitea-cc-release/releases) to get platform binary, then has local path
- binary path like `C:\Drone\drone-runner-exec\plugins\drone-feishu-group-robot.exe` can be drone run env like `EXEC_DRONE_GITEA-CC-RELEASE`
- env:EXEC_DRONE_GITEA-CC-RELEASE can set at file which define as [DRONE_RUNNER_ENVFILE](https://docs.drone.io/runner/exec/configuration/reference/drone-runner-envfile/) to support each platform to send feishu message
- download
by [https://github.com/convention-change/drone-gitea-cc-release/releases](https://github.com/convention-change/drone-gitea-cc-release/releases)
to get platform binary, then has local path
- binary path like `C:\Drone\drone-runner-exec\plugins\drone-feishu-group-robot.exe` can be drone run env
like `EXEC_DRONE_GITEA-CC-RELEASE`
- env:EXEC_DRONE_GITEA-CC-RELEASE can set at file which define
as [DRONE_RUNNER_ENVFILE](https://docs.drone.io/runner/exec/configuration/reference/drone-runner-envfile/) to support
each platform to send feishu message

```yaml
steps:
Expand All @@ -123,7 +130,7 @@ steps:
PLUGIN_DRAFT: true # default false
PLUGIN_RELEASE_GITEA_BASE_URL: https://gitea.xxxx.com
PLUGIN_RELEASE_GITEA_API_KEY:
from_secret: release_gitea_api_key
from_secret: release_gitea_api_key
# PLUGIN_RELEASE_GITEA_INSECURE: false # default false, visit base-url via insecure https protocol
PLUGIN_RELEASE_GITEA_FILES: "doc/*.md,**/*.zip" # release as files by glob pattern
PLUGIN_RELEASE_GITEA_FILES_CHECKSUM: "md5,sha1,sha256" # generate specific checksums, support [ md5 sha1 sha256 sha512 adler32 crc32 blake2b blake2s ]
Expand Down Expand Up @@ -153,16 +160,17 @@ or download by [github releases](https://github.com/convention-change/drone-gite

## env

- minimum go version: go 1.18
- change `go 1.18`, `^1.18`, `1.18.10` to new go version
- minimum go version: go 1.20
- change `go 1.20`, `^1.20`, `1.20.7` to new go version

### libs

| lib | version |
|:-------------------------------------------|:--------|
| https://github.com/stretchr/testify | v1.8.4 |
| https://github.com/sebdah/goldie | v2.5.3 |
| https://github.com/joho/godotenv | v1.4.0 |
| lib | version |
|:------------------------------------|:--------|
| https://github.com/stretchr/testify | v1.8.4 |
| https://github.com/sebdah/goldie | v2.5.3 |
| https://github.com/joho/godotenv | v1.4.0 |
| https://github.com/go-gitea/gitea | v0.15.1 |

# dev

Expand Down
4 changes: 2 additions & 2 deletions gitea_cc_release_plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func randomStr(cnt uint) string {
var letters = []byte("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
result := make([]byte, cnt)
keyL := len(letters)
rand.Seed(time.Now().Unix())
rand.NewSource(time.Now().Unix())
for i := range result {
result[i] = letters[rand.Intn(keyL)]
}
Expand All @@ -122,7 +122,7 @@ func randomStrBySed(cnt uint, sed string) string {
var letters = []byte(sed)
result := make([]byte, cnt)
keyL := len(letters)
rand.Seed(time.Now().Unix())
rand.NewSource(time.Now().Unix())
for i := range result {
result[i] = letters[rand.Intn(keyL)]
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/convention-change/drone-gitea-cc-release

go 1.18
go 1.20

require (
code.gitea.io/sdk/gitea v0.15.1
Expand Down

0 comments on commit 94dfb4f

Please sign in to comment.