Skip to content

Commit 7f80f7c

Browse files
authored
Merge branch 'main' into guewa-patch-1
2 parents a4d5e80 + b76abc6 commit 7f80f7c

Some content is hidden

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

48 files changed

+182
-347
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: ci
1+
name: CI
2+
23
on:
34
push:
45
tags:
@@ -8,33 +9,10 @@ on:
89
- main
910
pull_request:
1011

11-
jobs:
12-
build:
13-
runs-on: ubuntu-24.04
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18-
with:
19-
submodules: recursive
20-
21-
- name: Set up Go
22-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
23-
with:
24-
go-version-file: go.mod
12+
permissions:
13+
contents: read
2514

26-
- name: Install Task
27-
uses: arduino/setup-task@v2
28-
with:
29-
version: 3.x
30-
31-
- name: task generate
32-
run: |
33-
task generate --verbose
34-
git diff --exit-code
35-
36-
- name: task validate
37-
run: task validate --verbose
38-
39-
- name: task test
40-
run: task test --verbose
15+
jobs:
16+
build_validate_test:
17+
uses: openmcp-project/build/.github/workflows/ci.lib.yaml@main
18+
secrets: inherit

.github/workflows/publish.yaml

Lines changed: 6 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,15 @@
1-
name: publish
1+
name: Publish
2+
23
on:
34
push:
45
tags:
56
- v*
67
workflow_dispatch:
7-
88

9-
permissions:
9+
permissions:
1010
packages: write
1111

12-
env:
13-
OCI_URL: ghcr.io/openmcp-project
14-
1512
jobs:
16-
release_tag:
17-
name: Release version
18-
runs-on: ubuntu-24.04
19-
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
22-
with:
23-
ssh-key: ${{ secrets.PUSH_KEY }}
24-
fetch-tags: true
25-
fetch-depth: 0
26-
submodules: recursive
27-
28-
- name: Install Task
29-
uses: arduino/setup-task@v2
30-
with:
31-
version: 3.x
32-
33-
- name: Read and validate VERSION
34-
id: version
35-
run: |
36-
VERSION=$(task version)
37-
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev(-[0-9a-f]*)?)?$ ]]; then
38-
echo "Invalid version format: $VERSION"
39-
exit 1
40-
fi
41-
echo "New version: $VERSION"
42-
echo "version=$VERSION" >> $GITHUB_ENV
43-
44-
- name: Skip release if version is a dev version
45-
if: contains(env.version, '-dev')
46-
run: |
47-
echo "Skipping development version release: ${{ env.version }}"
48-
echo "SKIP=true" >> $GITHUB_ENV
49-
exit 0
50-
51-
- name: Set up QEMU
52-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
53-
54-
- name: Set up Docker Context for Buildx
55-
id: buildx-context
56-
run: |
57-
docker context create builders
58-
59-
- name: Login to GitHub Container Registry
60-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
61-
with:
62-
registry: ghcr.io
63-
username: ${{ github.actor }}
64-
password: ${{ secrets.GITHUB_TOKEN }}
65-
66-
- name: Set up Docker Buildx
67-
timeout-minutes: 5
68-
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
69-
with:
70-
version: latest
71-
72-
- name: Set up Go
73-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
74-
with:
75-
go-version-file: go.mod
76-
77-
- name: Build and Push Images
78-
run: |
79-
task build:img:all --verbose
80-
81-
- name: Package and Push Helm Charts
82-
run: |
83-
task build:helm:all --verbose
84-
85-
- name: Build and Push OCM Component
86-
run: |
87-
task build:ocm:all --verbose
13+
release_publish:
14+
uses: openmcp-project/build/.github/workflows/publish.lib.yaml@main
15+
secrets: inherit

.github/workflows/release.yaml

Lines changed: 4 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -4,140 +4,12 @@ on:
44
push:
55
branches:
66
- main
7-
7+
88
permissions:
99
contents: write # we need this to be able to push tags
10+
pull-requests: read
1011

1112
jobs:
1213
release_tag:
13-
name: Release version
14-
runs-on: ubuntu-24.04
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18-
with:
19-
ssh-key: ${{ secrets.PUSH_KEY }}
20-
fetch-tags: true
21-
fetch-depth: 0
22-
submodules: recursive
23-
24-
- name: Install Task
25-
uses: arduino/setup-task@v2
26-
with:
27-
version: 3.x
28-
29-
- name: Read and validate VERSION
30-
id: version
31-
run: |
32-
VERSION=$(task version)
33-
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev(-[0-9a-f]*)?)?$ ]]; then
34-
echo "Invalid version format: $VERSION"
35-
exit 1
36-
fi
37-
echo "New version: $VERSION"
38-
echo "version=$VERSION" >> $GITHUB_ENV
39-
40-
- name: Skip release if version is a dev version
41-
if: contains(env.version, '-dev')
42-
run: |
43-
echo "Skipping development version release: ${{ env.version }}"
44-
echo "SKIP=true" >> $GITHUB_ENV
45-
exit 0
46-
47-
- name: Check if VERSION is already tagged
48-
id: check_tag
49-
run: |
50-
if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
51-
echo "Tag ${{ env.version }} already exists. Skipping release."
52-
echo "SKIP=true" >> $GITHUB_ENV
53-
exit 0
54-
fi
55-
echo "Tag ${{ env.version }} doesn't exists. Proceeding with release."
56-
57-
- name: Create Git tag
58-
if: ${{ env.SKIP != 'true' }}
59-
run: |
60-
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
61-
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
62-
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
63-
64-
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
65-
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
66-
67-
git config user.name "$AUTHOR_NAME"
68-
git config user.email "$AUTHOR_EMAIL"
69-
70-
git tag -a "${{ env.version }}" -m "Release ${{ env.version }}"
71-
git push origin "${{ env.version }}"
72-
73-
- name: Create Git tag for api submodule
74-
if: ${{ env.SKIP != 'true' }}
75-
run: |
76-
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
77-
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
78-
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
79-
80-
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
81-
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
82-
83-
git config user.name "$AUTHOR_NAME"
84-
git config user.email "$AUTHOR_EMAIL"
85-
86-
git tag -a "api/${{ env.version }}" -m "Release ${{ env.version }}"
87-
git push origin "api/${{ env.version }}"
88-
89-
- name: Build Changelog
90-
id: github_release
91-
uses: mikepenz/release-changelog-builder-action@e92187bd633e680ebfdd15961a7c30b2d097e7ad # v5
92-
with:
93-
mode: "PR"
94-
configurationJson: |
95-
{
96-
"template": "#{{CHANGELOG}}",
97-
"pr_template": "- #{{TITLE}}: ##{{NUMBER}}",
98-
"categories": [
99-
{
100-
"title": "## Feature",
101-
"labels": ["feat", "feature"]
102-
},
103-
{
104-
"title": "## Fix",
105-
"labels": ["fix", "bug"]
106-
},
107-
{
108-
"title": "## Other",
109-
"labels": []
110-
}
111-
],
112-
"label_extractor": [
113-
{
114-
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
115-
"on_property": "title",
116-
"target": "$1"
117-
}
118-
]
119-
}
120-
env:
121-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122-
123-
- name: Create GitHub release
124-
if: ${{ env.SKIP != 'true' }}
125-
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2
126-
with:
127-
tag_name: ${{ env.version }}
128-
name: Release ${{ env.version }}
129-
body: ${{steps.github_release.outputs.changelog}}
130-
draft: true
131-
prerelease: false
132-
env:
133-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
135-
- name: Push dev VERSION
136-
if: ${{ env.SKIP != 'true' }}
137-
run: |
138-
task release:set-version --verbose -- "${{ env.version }}-dev"
139-
git config user.name "${{ env.AUTHOR_NAME }}"
140-
git config user.email "${{ env.AUTHOR_EMAIL }}"
141-
git add VERSION
142-
git commit -m "Update VERSION to ${{ env.version }}-dev"
143-
git push origin main
14+
uses: openmcp-project/build/.github/workflows/release.lib.yaml@main
15+
secrets: inherit

.github/workflows/reuse.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: REUSE Compliance Check
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
6-
test:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
10-
- name: REUSE Compliance Check
11-
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
9+
run_reuse:
10+
uses: openmcp-project/build/.github/workflows/reuse.lib.yaml@main
11+
secrets: inherit
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Validate Pull Request Content
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
validate_pr_content:
14+
uses: openmcp-project/build/.github/workflows/validate-pr-content.lib.yaml@main
15+
secrets: inherit

.golangci.yaml

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,50 @@
1+
version: "2"
12
run:
2-
concurrency: 4
3-
timeout: 10m
4-
5-
issues:
6-
exclude-files:
7-
- "zz_generated.*\\.go$"
8-
- "tmp/.*"
3+
allow-parallel-runners: true
4+
linters:
5+
default: none
6+
enable:
7+
- copyloopvar
8+
- errcheck
9+
- govet
10+
- ineffassign
11+
- misspell
12+
- nakedret
13+
- prealloc
14+
- revive
15+
- staticcheck
16+
- unconvert
17+
- unused
18+
settings:
19+
revive:
20+
rules:
21+
- name: comment-spacings
22+
misspell:
23+
ignore-rules:
24+
- "clas"
25+
exclusions:
26+
generated: lax
27+
rules:
28+
- linters:
29+
- lll
30+
path: api/*
31+
- linters:
32+
- dupl
33+
- lllgit ad
34+
path: internal/*
35+
paths:
36+
- zz_generated.*\.go$
37+
- tmp/.*
38+
- third_party$
39+
- builtin$
40+
- examples$
41+
formatters:
42+
enable:
43+
- gofmt
44+
- goimports
45+
exclusions:
46+
generated: lax
47+
paths:
48+
- third_party$
49+
- builtin$
50+
- examples$

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ package main
117117
118118
import (
119119
"fmt" // we need to import something here so golint is happy
120-
//+kubebuilder:scaffold:imports
120+
// +kubebuilder:scaffold:imports
121121
)
122122
123123
func main() {
124124
fmt.Println("I should never be called")
125-
//+kubebuilder:scaffold:builder
125+
// +kubebuilder:scaffold:builder
126126
}
127127
EOF
128128
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.28.0-dev
1+
v0.30.0-dev

0 commit comments

Comments
 (0)