Skip to content

Commit 4a4ed65

Browse files
chore: integrate build repository (#5)
* chore: add build repo * chore: integrate build repository * add hack/common * update hack/common
1 parent f46e919 commit 4a4ed65

26 files changed

+608
-580
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug
4+
labels: kind/bug
5+
6+
---
7+
8+
**What happened**:
9+
10+
**What you expected to happen**:
11+
12+
**How to reproduce it (as minimally and precisely as possible)**:
13+
14+
**Anything else we need to know**:
15+
16+
**Environment**:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Enhancement Request
3+
about: Suggest an enhancement
4+
labels: kind/enhancement
5+
6+
---
7+
8+
**What would you like to be added**:
9+
10+
**Why is this needed**:

.github/pull_request_template.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**What this PR does / why we need it**:
2+
3+
**Which issue(s) this PR fixes**:
4+
Fixes #
5+
6+
**Special notes for your reviewer**:
7+
8+
**Release note**:
9+
<!-- Write your release note:
10+
1. Enter your release note in the below block.
11+
2. If no release note is required, just write "NONE" within the block.
12+
13+
Format of block header: <category> <target_group>
14+
Possible values:
15+
- category: breaking|feature|bugfix|doc|other
16+
- target_group: user|operator|developer|dependency
17+
-->
18+
```feature user
19+
20+
```

.github/workflows/ci.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- master
9+
- main
10+
pull_request:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-24.04
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
27+
- name: Install Task
28+
uses: arduino/setup-task@v2
29+
with:
30+
version: 3.x
31+
32+
- name: task generate
33+
run: |
34+
task generate --verbose
35+
git diff --exit-code
36+
37+
- name: task validate
38+
run: task validate --verbose
39+
40+
- name: task test
41+
run: task test --verbose

.github/workflows/publish.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
9+
permissions:
10+
packages: write
11+
12+
env:
13+
OCI_URL: ghcr.io/openmcp-project
14+
15+
jobs:
16+
release_tag:
17+
name: Release version
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@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@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@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@v3
69+
with:
70+
version: latest
71+
72+
- name: Set up Go
73+
uses: actions/setup-go@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

.github/workflows/release.yaml

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

.github/workflows/reuse.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: REUSE Compliance Check
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: REUSE Compliance Check
11+
uses: fsfe/reuse-action@v5

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "hack/common"]
2+
path = hack/common
3+
url = https://github.com/openmcp-project/build.git

0 commit comments

Comments
 (0)