Skip to content

Commit 42e5c02

Browse files
committed
feat: add support for automatic templating
Any file which has `.tmpl` extension will be automatically templated through available variables and put back to the context with `.tmpl` removed. Signed-off-by: Andrey Smirnov <[email protected]>
1 parent c517c50 commit 42e5c02

File tree

29 files changed

+428
-77
lines changed

29 files changed

+428
-77
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-08-10T14:47:54Z by kres latest.
3+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
44

55
*
66
!cmd
@@ -11,3 +11,4 @@
1111
!CHANGELOG.md
1212
!README.md
1313
!.markdownlint.json
14+
!hack/govulncheck.sh

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-15T11:42:33Z by kres c691b83.
3+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
44

55
concurrency:
66
group: ${{ github.head_ref || github.run_id }}
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- name: gather-system-info
3434
id: system-info
35-
uses: kenchan0130/actions-system-info@v1.3.1
35+
uses: kenchan0130/actions-system-info@v1.4.0
3636
continue-on-error: true
3737
- name: print-system-info
3838
run: |
@@ -56,7 +56,7 @@ jobs:
5656
done
5757
continue-on-error: true
5858
- name: checkout
59-
uses: actions/checkout@v4
59+
uses: actions/checkout@v5
6060
- name: Unshallow
6161
run: |
6262
git fetch --prune --unshallow
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2+
#
3+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
4+
5+
"on":
6+
workflow_run:
7+
workflows:
8+
- default
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
name: slack-notify-failure
14+
jobs:
15+
slack-notify:
16+
runs-on:
17+
- self-hosted
18+
- generic
19+
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'pull_request'
20+
steps:
21+
- name: Slack Notify
22+
uses: slackapi/slack-github-action@v2
23+
with:
24+
method: chat.postMessage
25+
payload: |
26+
{
27+
"channel": "ci-failure",
28+
"text": "${{ github.event.workflow_run.conclusion }} - ${{ github.repository }}",
29+
"icon_emoji": "${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || github.event.workflow_run.conclusion == 'failure' && ':x:' || ':warning:' }}",
30+
"username": "GitHub Actions",
31+
"attachments": [
32+
{
33+
"blocks": [
34+
{
35+
"fields": [
36+
{
37+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}",
38+
"type": "mrkdwn"
39+
},
40+
{
41+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`",
42+
"type": "mrkdwn"
43+
}
44+
],
45+
"type": "section"
46+
},
47+
{
48+
"fields": [
49+
{
50+
"text": "*Author:*\n`${{ github.actor }}`",
51+
"type": "mrkdwn"
52+
},
53+
{
54+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`",
55+
"type": "mrkdwn"
56+
}
57+
],
58+
"type": "section"
59+
},
60+
{
61+
"type": "divider"
62+
},
63+
{
64+
"elements": [
65+
{
66+
"text": {
67+
"text": "Logs",
68+
"type": "plain_text"
69+
},
70+
"type": "button",
71+
"url": "${{ github.event.workflow_run.html_url }}"
72+
},
73+
{
74+
"text": {
75+
"text": "Commit",
76+
"type": "plain_text"
77+
},
78+
"type": "button",
79+
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
80+
}
81+
],
82+
"type": "actions"
83+
}
84+
],
85+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}"
86+
}
87+
]
88+
}
89+
token: ${{ secrets.SLACK_BOT_TOKEN_V2 }}
Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-15T11:42:33Z by kres c691b83.
3+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
44

55
"on":
66
workflow_run:
@@ -29,64 +29,66 @@ jobs:
2929
method: chat.postMessage
3030
payload: |
3131
{
32-
"channel": "proj-talos-maintainers",
32+
"channel": "ci-all",
33+
"text": "${{ github.event.workflow_run.conclusion }} - ${{ github.repository }}",
34+
"icon_emoji": "${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || github.event.workflow_run.conclusion == 'failure' && ':x:' || ':warning:' }}",
35+
"username": "GitHub Actions",
3336
"attachments": [
3437
{
35-
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
36-
"fallback": "test",
3738
"blocks": [
3839
{
39-
"type": "section",
4040
"fields": [
4141
{
42-
"type": "mrkdwn",
43-
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}"
42+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}",
43+
"type": "mrkdwn"
4444
},
4545
{
46-
"type": "mrkdwn",
47-
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`"
46+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`",
47+
"type": "mrkdwn"
4848
}
49-
]
49+
],
50+
"type": "section"
5051
},
5152
{
52-
"type": "section",
5353
"fields": [
5454
{
55-
"type": "mrkdwn",
56-
"text": "*Author:*\n`${{ github.actor }}`"
55+
"text": "*Author:*\n`${{ github.actor }}`",
56+
"type": "mrkdwn"
5757
},
5858
{
59-
"type": "mrkdwn",
60-
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`"
59+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`",
60+
"type": "mrkdwn"
6161
}
62-
]
62+
],
63+
"type": "section"
6364
},
6465
{
6566
"type": "divider"
6667
},
6768
{
68-
"type": "actions",
6969
"elements": [
7070
{
71-
"type": "button",
7271
"text": {
73-
"type": "plain_text",
74-
"text": "Logs"
72+
"text": "Logs",
73+
"type": "plain_text"
7574
},
75+
"type": "button",
7676
"url": "${{ github.event.workflow_run.html_url }}"
7777
},
7878
{
79-
"type": "button",
8079
"text": {
81-
"type": "plain_text",
82-
"text": "Commit"
80+
"text": "Commit",
81+
"type": "plain_text"
8382
},
83+
"type": "button",
8484
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
8585
}
86-
]
86+
],
87+
"type": "actions"
8788
}
88-
]
89+
],
90+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}"
8991
}
9092
]
9193
}
92-
token: ${{ secrets.SLACK_BOT_TOKEN }}
94+
token: ${{ secrets.SLACK_BOT_TOKEN_V2 }}

Dockerfile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2025-07-15T11:42:33Z by kres c691b83.
5+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
66

77
ARG TOOLCHAIN
88

9-
FROM ghcr.io/siderolabs/ca-certificates:v1.10.0 AS image-ca-certificates
9+
FROM ghcr.io/siderolabs/ca-certificates:v1.11.0 AS image-ca-certificates
1010

11-
FROM ghcr.io/siderolabs/fhs:v1.10.0 AS image-fhs
11+
FROM ghcr.io/siderolabs/fhs:v1.11.0 AS image-fhs
1212

1313
# runs markdownlint
14-
FROM docker.io/oven/bun:1.2.18-alpine AS lint-markdown
14+
FROM docker.io/oven/bun:1.2.20-alpine AS lint-markdown
1515
WORKDIR /src
1616
1717
COPY .markdownlint.json .
@@ -21,7 +21,7 @@ RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ig
2121

2222
# base toolchain image
2323
FROM --platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain
24-
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev
24+
RUN apk --update --no-cache add bash build-base curl jq protoc protobuf-dev
2525

2626
# build tools
2727
FROM --platform=${BUILDPLATFORM} toolchain AS tools
@@ -84,10 +84,19 @@ COPY .golangci.yml .
8484
ENV GOGC=50
8585
RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=bldr/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=bldr/go/pkg golangci-lint run --config .golangci.yml
8686

87+
# runs golangci-lint fmt
88+
FROM base AS lint-golangci-lint-fmt-run
89+
WORKDIR /src
90+
COPY .golangci.yml .
91+
ENV GOGC=50
92+
RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=bldr/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=bldr/go/pkg golangci-lint fmt --config .golangci.yml
93+
RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=bldr/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=bldr/go/pkg golangci-lint run --fix --issues-exit-code 0 --config .golangci.yml
94+
8795
# runs govulncheck
8896
FROM base AS lint-govulncheck
8997
WORKDIR /src
90-
RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=bldr/go/pkg govulncheck ./...
98+
COPY --chmod=0755 hack/govulncheck.sh ./hack/govulncheck.sh
99+
RUN --mount=type=cache,target=/root/.cache/go-build,id=bldr/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=bldr/go/pkg ./hack/govulncheck.sh ./...
91100

92101
# runs unit-tests with race detector
93102
FROM base AS unit-tests-race
@@ -111,6 +120,10 @@ RUN echo -n 'undefined' > internal/version/data/sha && \
111120
FROM scratch AS integration.test
112121
COPY --from=integration-build /src/integration.test /integration.test
113122

123+
# clean golangci-lint fmt output
124+
FROM scratch AS lint-golangci-lint-fmt
125+
COPY --from=lint-golangci-lint-fmt-run /src .
126+
114127
FROM scratch AS unit-tests
115128
COPY --from=unit-tests-run /src/coverage.txt /coverage-unit-tests.txt
116129

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-15T11:42:33Z by kres c691b83.
3+
# Generated on 2025-08-20T12:12:40Z by kres 18c31cf.
44

55
# common variables
66

@@ -17,21 +17,21 @@ WITH_RACE ?= false
1717
REGISTRY ?= ghcr.io
1818
USERNAME ?= siderolabs
1919
REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME)
20-
PROTOBUF_GO_VERSION ?= 1.36.6
20+
PROTOBUF_GO_VERSION ?= 1.36.7
2121
GRPC_GO_VERSION ?= 1.5.1
2222
GRPC_GATEWAY_VERSION ?= 2.27.1
2323
VTPROTOBUF_VERSION ?= 0.6.0
24-
GOIMPORTS_VERSION ?= 0.34.0
25-
GOMOCK_VERSION ?= 0.5.2
26-
DEEPCOPY_VERSION ?= v0.5.6
27-
GOLANGCILINT_VERSION ?= v2.2.2
24+
GOIMPORTS_VERSION ?= 0.36.0
25+
GOMOCK_VERSION ?= 0.6.0
26+
DEEPCOPY_VERSION ?= v0.5.8
27+
GOLANGCILINT_VERSION ?= v2.4.0
2828
GOFUMPT_VERSION ?= v0.8.0
29-
GO_VERSION ?= 1.24.5
29+
GO_VERSION ?= 1.25.0
3030
GO_BUILDFLAGS ?=
3131
GO_LDFLAGS ?=
3232
CGO_ENABLED ?= 0
3333
GOTOOLCHAIN ?= local
34-
GOEXPERIMENT ?= synctest
34+
GOEXPERIMENT ?=
3535
TESTPKGS ?= ./...
3636
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
3737
CONFORMANCE_IMAGE ?= ghcr.io/siderolabs/conform:latest
@@ -72,7 +72,7 @@ COMMON_ARGS += --build-arg=DEEPCOPY_VERSION="$(DEEPCOPY_VERSION)"
7272
COMMON_ARGS += --build-arg=GOLANGCILINT_VERSION="$(GOLANGCILINT_VERSION)"
7373
COMMON_ARGS += --build-arg=GOFUMPT_VERSION="$(GOFUMPT_VERSION)"
7474
COMMON_ARGS += --build-arg=TESTPKGS="$(TESTPKGS)"
75-
TOOLCHAIN ?= docker.io/golang:1.24-alpine
75+
TOOLCHAIN ?= docker.io/golang:1.25-alpine
7676

7777
# extra variables
7878

@@ -173,6 +173,9 @@ generate: ## Generate .proto definitions.
173173
lint-golangci-lint: ## Runs golangci-lint linter.
174174
@$(MAKE) target-$@
175175

176+
lint-golangci-lint-fmt: ## Runs golangci-lint formatter and tries to fix issues automatically.
177+
@$(MAKE) local-$@ DEST=.
178+
176179
lint-gofumpt: ## Runs gofumpt linter.
177180
@$(MAKE) target-$@
178181

go.mod

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/siderolabs/bldr
22

3-
go 1.24.1
4-
5-
toolchain go1.24.4
3+
go 1.25.0
64

75
replace github.com/anchore/syft => github.com/dsseng/syft v0.0.0-20250703101014-f39c35d156d9
86

@@ -11,19 +9,19 @@ require (
119
github.com/Masterminds/sprig/v3 v3.3.0
1210
github.com/anchore/syft v1.28.0
1311
github.com/containerd/platforms v1.0.0-rc.1
14-
github.com/emicklei/dot v1.8.0
15-
github.com/google/go-github/v67 v67.0.0
12+
github.com/emicklei/dot v1.9.0
13+
github.com/google/go-github/v74 v74.0.0
1614
github.com/hashicorp/go-multierror v1.1.1
1715
github.com/moby/buildkit v0.23.2
1816
github.com/moby/docker-image-spec v1.3.1
1917
github.com/opencontainers/go-digest v1.0.0
2018
github.com/opencontainers/image-spec v1.1.1
2119
github.com/otiai10/copy v1.14.1
22-
github.com/siderolabs/gen v0.8.4
20+
github.com/siderolabs/gen v0.8.5
2321
github.com/spf13/cobra v1.9.1
2422
github.com/stretchr/testify v1.10.0
2523
golang.org/x/oauth2 v0.30.0
26-
golang.org/x/sync v0.15.0
24+
golang.org/x/sync v0.16.0
2725
gopkg.in/yaml.v3 v3.0.1
2826
)
2927

0 commit comments

Comments
 (0)