Skip to content

Commit 359b516

Browse files
authored
chore: Automates README tool versions update (#443)
* chore: Automates README tool versions update Introduces a mechanism to automatically update the tool versions listed in the README file. This is achieved by parsing the `go.mod` files within the `tools` directory and the `Dockerfile` to extract the relevant version information. A script is added to perform the extraction and update the README. A scheduled GitHub Actions workflow is configured to run the script on a weekly basis and create a pull request if changes are detected. This ensures the README remains up-to-date with the latest tool versions, improving documentation accuracy and user experience. * chore: Adds script to bump Go version across repo Introduces a new script and associated Makefile target to automate the process of updating the Go version across multiple files, including go.mod, Dockerfile, docker-bake.hcl, and CI workflow configurations. This change simplifies the Go version upgrade process by handling updates in various configuration files and optionally refreshing the README versions table. * chore: bump go to 1.25.3
1 parent cd3616f commit 359b516

File tree

36 files changed

+397
-106
lines changed

36 files changed

+397
-106
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update README tool versions
2+
3+
on:
4+
workflow_dispatch: {}
5+
schedule:
6+
- cron: '0 6 * * 1' # Every Monday 06:00 UTC
7+
push:
8+
branches: [ master ]
9+
paths:
10+
- 'tools/**/go.mod'
11+
- 'Dockerfile'
12+
- 'scripts/update-readme-versions.sh'
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
jobs:
19+
update:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Update README versions
28+
run: |
29+
bash ./scripts/update-readme-versions.sh
30+
31+
- name: Create Pull Request if changed
32+
uses: peter-evans/create-pull-request@v7
33+
with:
34+
commit-message: 'chore(readme): sync tool versions from go.mod and Dockerfile'
35+
title: 'chore(readme): sync tool versions'
36+
body: |
37+
This PR updates README tool versions and base image from the project sources.
38+
branch: chore/update-readme-versions
39+
base: master
40+
add-paths: |
41+
README.md
42+
signoff: true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.25.2
1+
ARG GO_VERSION=1.25.3
22
ARG ALPINE_VERSION=3.22
33
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder
44

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ SHELL := env APP_NAME=$(APP_NAME) $(SHELL)
77
RELEASE_BRANCH?=master
88
SHELL := env RELEASE_BRANCH=$(RELEASE_BRANCH) $(SHELL)
99

10-
GOVERSION:=1.25
10+
# Go versions
11+
# GOVERSION controls go.mod language version (major.minor)
12+
# GOIMAGEVERSION controls the base image tag (major.minor[.patch]); defaults to GOVERSION
13+
GOVERSION?=1.25
14+
GOIMAGEVERSION?=$(GOVERSION)
1115

1216
TARGET_MAX_CHAR_NUM=20
1317

@@ -63,9 +67,18 @@ check-releaser:
6367
./scripts/release/check.sh
6468
.PHONY: check-releaser
6569

70+
## Bump Go version across the repo (go.mod, Dockerfile, bake, CI)
71+
# Usage examples:
72+
# make bump-go-version GOVERSION=1.26 # image will use 1.26
73+
# make bump-go-version GOVERSION=1.26 GOIMAGEVERSION=1.26.2
6674
bump-go-version:
67-
./scripts/bump-go.sh $(GOVERSION)
75+
./scripts/bump-go.sh $(GOVERSION) $(GOIMAGEVERSION)
6876
.PHONY: bump-go-version
6977

78+
## Update versions in README from go.mod and Dockerfile
79+
update-readme-versions:
80+
./scripts/update-readme-versions.sh
81+
.PHONY: update-readme-versions
82+
7083
.DEFAULT_GOAL := help
7184

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ docker pull ghcr.io/obalunenko/go-tools:latest
1515

1616
### Go base image
1717

18-
The base image is built on top of the official image [golang:1.25.2-alpine3.22](https://hub.docker.com/_/golang) and includes the following tools:
18+
The base image is built on top of the official image [golang:1.25.3-alpine3.22](https://hub.docker.com/_/golang) and includes the following tools:
1919

2020
#### Below is a full manifest of the tools available
2121

2222
| Tool | Version | Description |
2323
|--------------------------------------------------------------|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
24-
| [buf](https://github.com/bufbuild/buf) | v1.57.0 | The buf CLI is the best tool for working with Protocol Buffers |
25-
| [coverbadger](https://github.com/obalunenko/coverbadger) | v1.4.0 | Generate coverage badge images for Markdown files using Go |
26-
| [enumer](https://github.com/alvaroloes/enumer) | v1.1.2 | A Go tool to auto generate methods for your enums |
27-
| [envdoc](https://github.com/g4s8/envdoc) | v1.6.0 | Go tool to generate documentation for environment variables |
24+
| [buf](https://github.com/bufbuild/buf) | v1.58.0 | The buf CLI is the best tool for working with Protocol Buffers |
25+
| [coverbadger](https://github.com/obalunenko/coverbadger) | v1.4.0 | Generate coverage badge images for Markdown files using Go |
26+
| [enumer](https://github.com/alvaroloes/enumer) | v1.1.2 | A Go tool to auto generate methods for your enums |
27+
| [envdoc](https://github.com/g4s8/envdoc) | v1.7.0 | Go tool to generate documentation for environment variables |
2828
| [fiximports](https://golang.org/x/tools/cmd/fiximports) | v0.36.0 | The fiximports command fixes import declarations to use the canonical import path for packages that have an "import comment" as defined by <https://golang.org/s/go14customimport>. |
29-
| [go-enum](https://github.com/abice/go-enum) | v0.9.1 | An enum generator for go |
30-
| [gocov](https://github.com/axw/gocov) | v1.2.1 | Coverage testing tool for The Go Programming Language |
31-
| [gocov-html](https://github.com/matm/gocov-html) | v1.4.0 | Make pretty HTML output from gocov, a coverage testing tool for Go |
32-
| [gofumpt](https://mvdan.cc/gofumpt) | v0.9.0 | A stricter gofmt |
29+
| [go-enum](https://github.com/abice/go-enum) | v0.9.1 | An enum generator for go |
30+
| [gocov](https://github.com/axw/gocov) | v1.2.1 | Coverage testing tool for The Go Programming Language |
31+
| [gocov-html](https://github.com/matm/gocov-html) | v1.4.0 | Make pretty HTML output from gocov, a coverage testing tool for Go |
32+
| [gofumpt](https://mvdan.cc/gofumpt) | v0.9.1 | A stricter gofmt |
3333
| [goimports](https://golang.org/x/tools/cmd/goimports) | v0.36.0 | Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones |
34-
| [golangci-lint](https://github.com/golangci/golangci-lint) | v2.4.0 | Fast linters Runner for Go |
34+
| [golangci-lint](https://github.com/golangci/golangci-lint) | v2.5.0 | Fast linters Runner for Go |
3535
| [goose](https://github.com/pressly/goose/v3/cmd/goose) | v3.24.2 | A database migration tool |
36-
| [goreadme](https://github.com/posener/goreadme) | v1.4.2 | Generate readme file from Go doc |
37-
| [goreleaser](https://github.com/goreleaser/goreleaser) | v2.12.0 | Deliver Go binaries as fast and easily as possible |
38-
| [gotestsum](https://gotest.tools/gotestsum) | v1.12.3 | 'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results. |
39-
| [goveralls](https://github.com/mattn/goveralls) | v0.0.12 | Go integration for Coveralls.io continuous code coverage tracking system. |
36+
| [goreadme](https://github.com/posener/goreadme) | v1.4.2 | Generate readme file from Go doc |
37+
| [goreleaser](https://github.com/goreleaser/goreleaser) | v2.12.5 | Deliver Go binaries as fast and easily as possible |
38+
| [gotestsum](https://gotest.tools/gotestsum) | v1.13.0 | 'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results. |
39+
| [goveralls](https://github.com/mattn/goveralls) | v0.0.12 | Go integration for Coveralls.io continuous code coverage tracking system. |
4040
| [govulncheck](https://golang.org/x/vuln/cmd/govulncheck) | v1.1.4 | Govulncheck reports known vulnerabilities that affect Go code. |
41-
| [gowrap](https://github.com/hexdigest/gowrap) | v1.4.3 | GoWrap is a command line tool for generating decorators for Go interfaces |
42-
| [mockery](https://github.com/vektra/mockery) | v3.5.4 | A mock code autogenerator for Go |
43-
| [mockgen](https://github.com/uber-go/mock) | v0.6.0 | GoMock is a mocking framework for the Go programming language. |
44-
| [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen) | v2.5.0 | Generate Go client and server boilerplate from OpenAPI 3 specifications |
41+
| [gowrap](https://github.com/hexdigest/gowrap) | v1.4.3 | GoWrap is a command line tool for generating decorators for Go interfaces |
42+
| [mockery](https://github.com/vektra/mockery) | v3.5.5 | A mock code autogenerator for Go |
43+
| [mockgen](https://github.com/uber-go/mock) | v0.6.0 | GoMock is a mocking framework for the Go programming language. |
44+
| [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen) | v2.5.0 | Generate Go client and server boilerplate from OpenAPI 3 specifications |
4545
| [pp](https://github.com/maruel/panicparse/v2) | v2.5.0 | Panicparse Parses panic stack traces, densifies and deduplicates goroutines with similar stack traces. Helps debugging crashes and deadlocks in heavily parallelized processes. |
46-
| [sqlc](https://github.com/sqlc-dev/sqlc) | v1.30.0 | Generate type-safe code from SQL |
46+
| [sqlc](https://github.com/sqlc-dev/sqlc) | v1.30.0 | Generate type-safe code from SQL |
4747
| [stringer](https://golang.org/x/tools/cmd/stringer) | v0.36.0 | Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface. |
48-
| [svu](https://github.com/caarlos0/svu) | v3.2.3 | Semantic Version Util |
48+
| [svu](https://github.com/caarlos0/svu) | v3.2.4 | Semantic Version Util |
4949
| [swag](github.com/swaggo/swag/cmd/swag) | v2.0.0-rc4 | Automatically generate RESTful API documentation with Swagger 2.0 for Go |
50-
| [swagger](https://github.com/go-swagger/go-swagger) | v0.32.3 | Client/Server from OpenAPI docs generation tool |
51-
| [tbls](https://github.com/k1LoW/tbls) | v1.88.0 | tbls is a CI-Friendly tool to document a database, written in Go. |
52-
| [tparse](https://github.com/mfridman/tparse) | v0.17.0 | CLI tool for summarizing go test output. Pipe friendly. CI/CD friendly. |
50+
| [swagger](https://github.com/go-swagger/go-swagger) | v0.33.1 | Client/Server from OpenAPI docs generation tool |
51+
| [tbls](https://github.com/k1LoW/tbls) | v1.89.1 | tbls is a CI-Friendly tool to document a database, written in Go. |
52+
| [tparse](https://github.com/mfridman/tparse) | v0.18.0 | CLI tool for summarizing go test output. Pipe friendly. CI/CD friendly. |
5353

5454
## How to Use
5555

docker-bake.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ target "gotools-latest" {
3535
"linux/arm64"
3636
]
3737
args = {
38-
GO_VERSION = "1.25.2"
38+
GO_VERSION = "1.25.3"
3939
ALPINE_VERSION = "3.22"
4040
}
4141
labels = {

0 commit comments

Comments
 (0)