Skip to content

Commit 1e3e144

Browse files
authored
Merge branch 'main' into fix/containerd-config-default-last
2 parents 087bdf9 + d596d9a commit 1e3e144

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+667
-664
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
28+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
2929
with:
30-
go-version: "1.21"
30+
go-version: "1.23"
3131
- run: make test
3232

3333
golangci:
3434
name: Golangci-lint
3535
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
38+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3939
with:
40-
go-version: "1.21"
40+
go-version: "1.23"
4141
- name: golangci-lint
42-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
42+
uses: golangci/golangci-lint-action@2e788936b09dd82dc280e845628a40d2ba6b204c # v6.3.1
4343
with:
44-
version: v1.57.2
44+
version: v1.63.4
4545
skip-cache: true

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: "Checkout repository"
2525
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
- name: "Dependency Review"
27-
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
27+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
2828
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
2929
with:
3030
comment-summary-in-pr: always
Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,75 @@
11
# This action releases the runtime-class-manager helm chart
2-
# The action must run on each commit done against main, however
3-
# a new release will be performed **only** when a change occurs inside
4-
# of the `charts` directory.
2+
#
3+
# A chart is published to the configured OCI registry on every push to main
4+
# as well as on semver tag releases (via workflow_call from release.yml).
55
name: Release helm chart
66

7-
permissions:
8-
contents: read
9-
107
on:
118
push:
129
branches:
1310
- main
11+
workflow_call:
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
env:
18+
REGISTRY: ghcr.io
19+
CHART_NAME: runtime-class-manager
1420

1521
jobs:
1622
release:
17-
runs-on: ubuntu-latest
18-
19-
permissions:
20-
id-token: write
21-
packages: write
22-
contents: write
23+
name: Release chart
24+
runs-on: ubuntu-22.04
2325

2426
steps:
25-
- name: Checkout
26-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
- uses: actions/checkout@v4
28+
29+
- name: Install helm
30+
uses: Azure/setup-helm@v4
2731
with:
28-
fetch-depth: 0
32+
version: v3.16.3
2933

30-
- name: Configure Git
34+
- name: Determine chart version
3135
run: |
32-
git config user.name "$GITHUB_ACTOR"
33-
git config user.email "[email protected]"
36+
if [[ "${{ startsWith(github.ref, 'refs/tags/v') }}" == "true" ]]; then
37+
# NOTE: We remove the leading 'v' to comply with helm's versioning requirements
38+
echo "CHART_VERSION=$(echo -n ${{ github.ref_name }} | sed -rn 's/(v)?(.*)/\2/p')" >> $GITHUB_ENV
39+
echo "APP_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
40+
else
41+
# NOTE: We can replace 0.0.0 with e.g. $(git describe --tags $(git rev-list --tags --max-count=1)) once we have a first tag
42+
# However, we'll also need to update the checkout step with 'fetch-depth: 0' if we list tags
43+
echo "CHART_VERSION=0.0.0-$(date +%Y%m%d-%H%M%S)-g$(git rev-parse --short HEAD)" >> $GITHUB_ENV
44+
# Setting to 'latest' to match tag used in container-image.yml
45+
echo "APP_VERSION=latest" >> $GITHUB_ENV
46+
fi
3447
35-
- name: Install Helm
36-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
48+
- name: Log into registry ${{ env.REGISTRY }}
49+
uses: docker/login-action@v3
3750
with:
38-
version: v3.14.0
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Package chart
56+
run: make helm-package
57+
58+
- name: Lint packaged chart
59+
run: make helm-lint
3960

40-
- name: Run chart-releaser
41-
if: github.ref == 'refs/heads/main'
42-
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
61+
- name: Upload chart as GitHub artifact
62+
uses: actions/upload-artifact@v4
4363
with:
44-
charts_dir: deploy/helm
64+
name: ${{ env.CHART_NAME }}
65+
path: _dist/${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}.tgz
66+
67+
- name: Publish chart
4568
env:
46-
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
47-
CR_RELEASE_NAME_TEMPLATE: "{{ .Name }}-chart-{{ .Version }}"
69+
CHART_REGISTRY: ${{ env.REGISTRY }}/${{ github.repository_owner }}/charts
70+
run: |
71+
make helm-publish
72+
73+
echo '### Helm chart published:' >> $GITHUB_STEP_SUMMARY
74+
echo '- `Reference: ${{ env.CHART_REGISTRY }}/${{ env.CHART_NAME }}`' >> $GITHUB_STEP_SUMMARY
75+
echo '- `Version: ${{ env.CHART_VERSION }}`' >> $GITHUB_STEP_SUMMARY

.github/workflows/helm-chart-smoketest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: apply Spin shim
8888
run: |
8989
# Ensure shim binary is compatible with runner arch
90-
yq -i '.spec.fetchStrategy.anonHttp.location = "https://github.com/spinkube/containerd-shim-spin/releases/download/${{ env.SHIM_SPIN_VERSION }}/containerd-shim-spin-v2-linux-x86_64.tar.gz"' \
90+
yq -i '.spec.fetchStrategy.anonHttp.location = "https://github.com/spinframework/containerd-shim-spin/releases/download/${{ env.SHIM_SPIN_VERSION }}/containerd-shim-spin-v2-linux-x86_64.tar.gz"' \
9191
config/samples/test_shim_spin.yaml
9292
kubectl apply -f config/samples/test_shim_spin.yaml
9393

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
# Drafts your next Release notes as Pull Requests are merged into "master"
31-
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
31+
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
3232
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
3333
# with:
3434
# config-name: my-config.yml

.github/workflows/release.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,35 @@ jobs:
3131
packages: write
3232
contents: read
3333

34+
build-downloader:
35+
name: Build downloader image, sign it, and generate SBOMs
36+
uses: ./.github/workflows/downloader-build.yml
37+
permissions:
38+
id-token: write
39+
packages: write
40+
contents: read
41+
42+
publish-chart:
43+
name: Publish the helm chart to the configured OCI registry
44+
uses: ./.github/workflows/helm-chart-release.yml
45+
permissions:
46+
packages: write
47+
contents: read
48+
needs:
49+
- ci
50+
- build-manager
51+
- build-installer
52+
- build-downloader
53+
3454
release:
3555
name: Create release
3656

3757
needs:
3858
- ci
3959
- build-manager
4060
- build-installer
61+
- build-downloader
62+
- publish-chart
4163

4264
permissions:
4365
contents: write
@@ -50,22 +72,6 @@ jobs:
5072
run: |
5173
echo TAG_NAME=$(echo ${{ github.ref_name }}) >> $GITHUB_ENV
5274
53-
- name: Get latest release tag
54-
id: get_last_release_tag
55-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
56-
with:
57-
script: |
58-
let release = await github.rest.repos.getLatestRelease({
59-
owner: context.repo.owner,
60-
repo: context.repo.repo,
61-
});
62-
63-
if (release.status === 200 ) {
64-
core.setOutput('old_release_tag', release.data.tag_name)
65-
return
66-
}
67-
core.setFailed("Cannot find latest release")
68-
6975
- name: Get release ID from the release created by release drafter
7076
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7177
with:
@@ -84,12 +90,18 @@ jobs:
8490
core.setFailed(`Draft release not found`)
8591
8692
- name: Download SBOM artifact
87-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
93+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
8894
with:
8995
pattern: "*-sbom-*"
9096
path: ./
9197
merge-multiple: true
9298

99+
- name: Download helm chart artifact
100+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
101+
with:
102+
name: runtime-class-manager
103+
path: ./
104+
93105
- name: Display structure of downloaded files
94106
run: ls -R
95107

@@ -101,6 +113,9 @@ jobs:
101113
let fs = require('fs');
102114
let path = require('path');
103115
116+
// The chart version omits the leading 'v' to adhere to Helm's versioning requirements
117+
let chartVersion = "${{ env.TAG_NAME }}".replace("v", "");
118+
104119
let files = [
105120
'runtime-class-manager-sbom-amd64.spdx',
106121
'runtime-class-manager-sbom-amd64.spdx.cert',
@@ -114,6 +129,13 @@ jobs:
114129
'node-installer-sbom-arm64.spdx',
115130
'node-installer-sbom-arm64.spdx.cert',
116131
'node-installer-sbom-arm64.spdx.sig',
132+
'shim-downloader-sbom-amd64.spdx',
133+
'shim-downloader-sbom-amd64.spdx.cert',
134+
'shim-downloader-sbom-amd64.spdx.sig',
135+
'shim-downloader-sbom-arm64.spdx',
136+
'shim-downloader-sbom-arm64.spdx.cert',
137+
'shim-downloader-sbom-arm64.spdx.sig',
138+
`runtime-class-manager-${chartVersion}.tgz`,
117139
]
118140
const {RELEASE_ID} = process.env
119141

.github/workflows/sbom.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Install cosign
29-
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
29+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
3030

3131
- name: Install the syft command
32-
uses: anchore/sbom-action/download-syft@fc46e51fd3cb168ffb36c6d1915723c47db58abb # v0.17.7
32+
uses: anchore/sbom-action/download-syft@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
3333

3434
- name: Install the crane command
35-
uses: IAreKyleW00t/crane-installer@42ae002485110213e1a2f98caf04bd928c49afda # v1.3
35+
uses: IAreKyleW00t/crane-installer@714fc1e08f8f301abca2f140eba36d9a14e8c5e6 # v1.3
3636

3737
- name: Login to GitHub Container Registry
3838
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
40+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -68,6 +68,6 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
71+
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
7272
with:
7373
sarif_file: results.sarif

.github/workflows/sign-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Install cosign
25-
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
25+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
2626

2727
- name: Login to GitHub Container Registry
2828
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0

.golangci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,19 @@ linters:
188188
- asasalint # checks for pass []any as any in variadic func(...any)
189189
- asciicheck # checks that your code does not contain non-ASCII identifiers
190190
- bidichk # checks for dangerous unicode character sequences
191+
- copyloopvar # Copyloopvar is a linter detects places where loop variables are copied.
191192
- cyclop # checks function and package cyclomatic complexity
192193
- dupl # tool for code clone detection
193194
- errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
194195
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
195-
- exportloopref # checks for pointers to enclosing loop variables
196196
- forbidigo # forbids identifiers
197197
- funlen # tool for detection of long functions
198198
- gocognit # computes and checks the cognitive complexity of functions
199199
- goconst # finds repeated strings that could be replaced by a constant
200200
- gocritic # provides diagnostics that check for bugs, performance and style issues
201201
- gocyclo # computes and checks the cyclomatic complexity of functions
202202
- goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt
203-
- gomnd # detects magic numbers
203+
- mnd # detects magic numbers
204204
- goprintffuncname # checks that printf-like functions are named with f at the end
205205
- gosec # inspects source code for security problems
206206
- makezero # finds slice declarations with non-zero initial length

0 commit comments

Comments
 (0)