Skip to content

Commit 93dc691

Browse files
committed
run go-makefile-maker and ghcr.io workflow
1 parent 0646da0 commit 93dc691

21 files changed

+219
-45
lines changed

.dockerignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
# TODO: uncomment when applications no longer use git to get version information
88
#.git/
99
/.github/
10-
/.gitignore
11-
/.golangci.yaml
1210
/.goreleaser.yml
1311
/.vscode/
1412
/CONTRIBUTING.md
1513
/Dockerfile
16-
/LICENSE*
1714
/Makefile.maker.yaml
1815
/README.md
1916
/build/

.github/renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"matchPackageNames": [
6666
"/^k8s.io\\//"
6767
],
68-
"allowedVersions": "0.28.x"
68+
"allowedVersions": "0.33.x"
6969
}
7070
],
7171
"prHourlyLimit": 0,

.github/workflows/checks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
uses: actions/setup-go@v6
3030
with:
3131
check-latest: true
32-
go-version: 1.25.3
32+
go-version: 1.25.4
3333
- name: Run golangci-lint
34-
uses: golangci/golangci-lint-action@v8
34+
uses: golangci/golangci-lint-action@v9
3535
with:
3636
version: latest
3737
- name: Delete pre-installed shellcheck

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
check-latest: true
35-
go-version: 1.25.3
35+
go-version: 1.25.4
3636
- name: Build all binaries
3737
run: make build-all
3838
code_coverage:
@@ -65,11 +65,11 @@ jobs:
6565
uses: actions/setup-go@v6
6666
with:
6767
check-latest: true
68-
go-version: 1.25.3
68+
go-version: 1.25.4
6969
- name: Run tests and generate coverage report
7070
run: make build/cover.out
7171
- name: Archive code coverage results
72-
uses: actions/upload-artifact@v4
72+
uses: actions/upload-artifact@v5
7373
with:
7474
name: code-coverage
7575
path: build/cover.out
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Cleanup GHCR Images
5+
"on":
6+
push:
7+
branches:
8+
- main
9+
workflow_dispatch: {}
10+
permissions:
11+
contents: read
12+
packages: write
13+
jobs:
14+
cleanup:
15+
name: Cleanup old container images in GHCR
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Delete untagged GHCR images
19+
uses: actions/delete-package-versions@v5
20+
with:
21+
package-name: 'openstack-hypervisor-operator'
22+
package-type: 'container'
23+
min-versions-to-keep: 1
24+
delete-only-untagged-versions: 'true'

.github/workflows/codeql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
check-latest: true
35-
go-version: 1.25.3
35+
go-version: 1.25.4
3636
- name: Initialize CodeQL
3737
uses: github/codeql-action/init@v4
3838
with:
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
################################################################################
2+
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
3+
# Edit Makefile.maker.yaml instead. #
4+
################################################################################
5+
6+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
name: Container Registry GHCR
10+
"on":
11+
push:
12+
branches:
13+
- main
14+
workflow_dispatch: {}
15+
permissions:
16+
contents: read
17+
packages: write
18+
jobs:
19+
build-and-push-image:
20+
name: Push container to ghcr.io
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Check out code
24+
uses: actions/checkout@v5
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
- name: Extract metadata (tags, labels) for Docker
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ghcr.io/${{ github.repository }}
36+
tags: |
37+
# https://github.com/docker/metadata-action#typeedge
38+
type=edge
39+
# https://github.com/docker/metadata-action#latest-tag
40+
type=raw,value=latest,enable={{is_default_branch}}
41+
# https://github.com/docker/metadata-action#typesemver
42+
type=semver,pattern={{raw}}
43+
type=semver,pattern=v{{major}}.{{minor}}
44+
type=semver,pattern=v{{major}}
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
- name: Build and push Docker image
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
labels: ${{ steps.meta.outputs.labels }}
54+
platforms: linux/amd64,linux/arm64
55+
push: true
56+
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/publish-helm.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Publish Helm Chart GHCR
5+
"on":
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'charts/**'
11+
workflow_dispatch: {}
12+
13+
14+
jobs:
15+
publish-chart:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write # Required to push to GHCR
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v5
24+
25+
- name: Install Helm
26+
uses: azure/[email protected]
27+
28+
- name: Package Helm chart
29+
run: |
30+
helm package ./charts/kvm-node-agent
31+
32+
- name: Log in to GHCR
33+
run: |
34+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin
35+
36+
- name: Push Helm chart to GHCR
37+
run: |
38+
CHART_NAME=kvm-node-agent
39+
CHART_VERSION=$(grep "version:" ./charts/${CHART_NAME}/Chart.yaml | awk '{print $2}')
40+
helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://ghcr.io/${{ github.repository_owner }}"

.golangci.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ linters:
5757
- intrange
5858
- iotamixing
5959
- misspell
60+
- modernize
6061
- nilerr
6162
- nolintlint
6263
- nosprintfhostport
@@ -144,6 +145,13 @@ linters:
144145
enable-all: true
145146
nolintlint:
146147
require-specific: true
148+
modernize:
149+
disable:
150+
# omitzero requires removing omitempty tags in kubernetes api struct types which are nested, which is intepreted by controller-gen and breaks the CRDs.
151+
- omitzero
152+
perfsprint:
153+
# modernize generates nicer fix code
154+
concat-loop: false
147155
staticcheck:
148156
dot-import-whitelist:
149157
- github.com/majewsky/gg/option
@@ -168,13 +176,13 @@ linters:
168176
exclusions:
169177
generated: lax
170178
presets:
171-
- comments
172179
- common-false-positives
173180
- legacy
174181
- std-error-handling
175182
rules:
176183
- linters:
177184
- bodyclose
185+
- revive
178186
path: _test\.go
179187
# It is idiomatic Go to reuse the name 'err' with ':=' for subsequent errors.
180188
# Ref: https://go.dev/doc/effective_go#redeclaration

.license-scan-overrides.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{"name": "github.com/chzyer/logex", "licenceType": "MIT"}
2+
{"name": "github.com/grpc-ecosystem/go-grpc-middleware/v2", "licenceType": "Apache-2.0"}
23
{"name": "github.com/hashicorp/vault/api/auth/approle", "licenceType": "MPL-2.0"}
34
{"name": "github.com/jpillora/longestcommon", "licenceType": "MIT"}
45
{"name": "github.com/logrusorgru/aurora", "licenceType": "Unlicense"}

0 commit comments

Comments
 (0)