1
0
mirror of https://github.com/siderolabs/kres.git synced 2026-02-05 09:45:35 +01:00

feat: implement update-checksums flow for pkgs

Based on https://github.com/siderolabs/bldr/pull/207, provide a simple
make target to quickly update checksums.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov
2025-09-15 20:45:35 +04:00
parent 7918c5de44
commit 06e6a5f4fb
2 changed files with 12 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ const (
// BldrImageVersion is the version of bldr image.
// renovate: datasource=github-releases depName=siderolabs/bldr
BldrImageVersion = "v0.5.3"
BldrImageVersion = "v0.5.4"
// CheckOutActionVersion is the version of checkout github action.
// renovate: datasource=github-releases extractVersion=^(?<version>v\d+)\.\d+\.\d+$ depName=actions/checkout

View File

@@ -138,6 +138,17 @@ func (pkgfile *Build) CompileMakefile(output *makefile.Output) error {
Description("Builds the specified target defined in the Pkgfile using the local output type with and without cahce. The build result will be output to the specified local destination").
Script(reproducibilityTestScript)
output.Target("$(ARTIFACTS)/bldr").
Description("Downloads bldr binary.").
Script(bldrDownloadScript).
Depends("$(ARTIFACTS)")
output.Target("update-checksums").
Depends("$(ARTIFACTS)/bldr").
Phony().
Description("Updates the checksums in the Pkgfile/vars.yaml based on the changed version variables.").
Script(`@git diff -U0 | $(ARTIFACTS)/bldr update`)
output.VariableGroup(makefile.VariableGroupTargets).
Variable(makefile.RecursiveVariable("TARGETS", strings.Join(pkgfile.Targets, "\n")))
@@ -165,11 +176,6 @@ func (pkgfile *Build) CompileMakefile(output *makefile.Output) error {
Script("@$(MAKE) docker-$@ TARGET_ARGS=\"--tag=$(REGISTRY)/$(USERNAME)/$@:$(shell $(ARTIFACTS)/bldr eval --target $@ --build-arg TAG=$(TAG) '{{.VERSION}}' 2>/dev/null) --push=$(PUSH)\"").
Phony().
Depends("$(ARTIFACTS)/bldr")
output.Target("$(ARTIFACTS)/bldr").
Description("Downloads bldr binary.").
Script(bldrDownloadScript).
Depends("$(ARTIFACTS)")
} else {
output.Target(defaultTarget).
Script("@$(MAKE) docker-$@ TARGET_ARGS=\"--tag=$(REGISTRY_AND_USERNAME)/$@:$(TAG) --push=$(PUSH)\"").