Cleaner chain of authority for golang update (gotify/build -> go.mod -> GO_VERSION) (#780)

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
饺子w (Yumechi) 2025-03-12 23:37:23 +00:00 committed by GitHub
parent fbf0f6cfc9
commit c44c4ef980
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 2 deletions

View File

@ -2,7 +2,11 @@ LICENSE_DIR=./licenses/
BUILD_DIR=./build
DOCKER_DIR=./docker/
SHELL := /bin/bash
GO_VERSION=`cat GO_VERSION`
ifndef GOTOOLCHAIN
GO_VERSION=$(GOTOOLCHAIN)
else
GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//')
endif
DOCKER_BUILD_IMAGE=gotify/build
DOCKER_WORKDIR=/proj
DOCKER_RUN=docker run --rm -e LD_FLAGS="$$LD_FLAGS" -v "$$PWD/.:${DOCKER_WORKDIR}" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w ${DOCKER_WORKDIR}
@ -100,7 +104,7 @@ build-docker-multiarch: require-version
-t ghcr.io/gotify/server-riscv64:$(shell echo $(VERSION) | cut -d '.' -f -2) \
-t ghcr.io/gotify/server-riscv64:$(shell echo $(VERSION) | cut -d '.' -f -1) \
--build-arg RUN_TESTS=$(DOCKER_TEST_LEVEL) \
--build-arg GO_VERSION=$(shell cat GO_VERSION) \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg LD_FLAGS="$$LD_FLAGS" \
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/riscv64 \
-f docker/Dockerfile .

View File

@ -30,8 +30,26 @@
"autoReplaceStringTemplate": "{{{newValue}}}",
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
},
{
"customType": "regex",
"fileMatch": [
"^go.mod$"
],
"depTypeTemplate": "language",
"matchStrings": [
"toolchain go(?<currentValue>[0-9.]+)\\n"
],
"extractVersionTemplate": "^(?<version>.+)-linux-amd64$",
"depNameTemplate": "docker.io/gotify/build",
"autoReplaceStringTemplate": "toolchain go{{{newValue}}}\n",
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
],
"ignoreDeps": [
"go"
],
"packageRules": [
{
"matchManagers": [
@ -43,6 +61,13 @@
],
"groupName": "Bump Go dependencies",
"groupSlug": "bump-dependencies-go"
},
{
"matchDepNames": [
"github.com/gotify/build"
],
"groupName": "Bump gotify/build",
"groupSlug": "bump-gotify-build"
}
],
"postUpdateOptions": [