Skip to content

Commit c44c4ef

Browse files
Cleaner chain of authority for golang update (gotify/build -> go.mod -> GO_VERSION) (#780)
Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
1 parent fbf0f6c commit c44c4ef

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ LICENSE_DIR=./licenses/
22
BUILD_DIR=./build
33
DOCKER_DIR=./docker/
44
SHELL := /bin/bash
5-
GO_VERSION=`cat GO_VERSION`
5+
ifndef GOTOOLCHAIN
6+
GO_VERSION=$(GOTOOLCHAIN)
7+
else
8+
GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//')
9+
endif
610
DOCKER_BUILD_IMAGE=gotify/build
711
DOCKER_WORKDIR=/proj
812
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
100104
-t ghcr.io/gotify/server-riscv64:$(shell echo $(VERSION) | cut -d '.' -f -2) \
101105
-t ghcr.io/gotify/server-riscv64:$(shell echo $(VERSION) | cut -d '.' -f -1) \
102106
--build-arg RUN_TESTS=$(DOCKER_TEST_LEVEL) \
103-
--build-arg GO_VERSION=$(shell cat GO_VERSION) \
107+
--build-arg GO_VERSION=$(GO_VERSION) \
104108
--build-arg LD_FLAGS="$$LD_FLAGS" \
105109
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/riscv64 \
106110
-f docker/Dockerfile .

renovate.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,26 @@
3030
"autoReplaceStringTemplate": "{{{newValue}}}",
3131
"datasourceTemplate": "docker",
3232
"versioningTemplate": "docker"
33+
},
34+
{
35+
"customType": "regex",
36+
"fileMatch": [
37+
"^go.mod$"
38+
],
39+
"depTypeTemplate": "language",
40+
"matchStrings": [
41+
"toolchain go(?<currentValue>[0-9.]+)\\n"
42+
],
43+
"extractVersionTemplate": "^(?<version>.+)-linux-amd64$",
44+
"depNameTemplate": "docker.io/gotify/build",
45+
"autoReplaceStringTemplate": "toolchain go{{{newValue}}}\n",
46+
"datasourceTemplate": "docker",
47+
"versioningTemplate": "docker"
3348
}
3449
],
50+
"ignoreDeps": [
51+
"go"
52+
],
3553
"packageRules": [
3654
{
3755
"matchManagers": [
@@ -43,6 +61,13 @@
4361
],
4462
"groupName": "Bump Go dependencies",
4563
"groupSlug": "bump-dependencies-go"
64+
},
65+
{
66+
"matchDepNames": [
67+
"github.com/gotify/build"
68+
],
69+
"groupName": "Bump gotify/build",
70+
"groupSlug": "bump-gotify-build"
4671
}
4772
],
4873
"postUpdateOptions": [

0 commit comments

Comments
 (0)