Skip to content

Commit 78fdd92

Browse files
authored
chore: migrate to use taskfiles and common github actions (#57)
* add submodule * generated files * fix lint * restructure the files * fix artifacts build * crd updates * add dev targets * add shared workflows * review comments * update README and small fixes
1 parent c691109 commit 78fdd92

36 files changed

+309
-1746
lines changed

.dockerignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- master
9+
- main
10+
pull_request:
11+
12+
permissions:
13+
contents: write
14+
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: 5 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,15 @@
1-
name: publish
1+
name: Publish
2+
23
on:
34
push:
45
tags:
56
- v*
67
workflow_dispatch:
78

8-
99
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@v4
22-
with:
23-
ssh-key: ${{ secrets.PUSH_KEY }}
24-
fetch-tags: true
25-
fetch-depth: 0
26-
27-
- name: Read and validate VERSION
28-
id: version
29-
run: |
30-
VERSION=$(cat VERSION)
31-
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then
32-
echo "Invalid version format in VERSION file: $VERSION"
33-
exit 1
34-
fi
35-
echo "New version: $VERSION"
36-
echo "version=$VERSION" >> $GITHUB_ENV
37-
38-
- name: Skip release if version is a dev version
39-
if: contains(env.version, '-dev')
40-
run: |
41-
echo "Skipping development version release: ${{ env.version }}"
42-
echo "SKIP=true" >> $GITHUB_ENV
43-
exit 0
44-
45-
- name: Set up Docker
46-
uses: docker/setup-docker-action@v4
47-
with:
48-
daemon-config: |
49-
{
50-
"features": {
51-
"containerd-snapshotter": true
52-
}
53-
}
54-
55-
- name: Set up QEMU
56-
uses: docker/setup-qemu-action@v2
57-
58-
- name: Set up Docker Context for Buildx
59-
id: buildx-context
60-
run: |
61-
docker context create builders
62-
63-
- name: Login to GitHub Container Registry
64-
uses: docker/login-action@v3
65-
with:
66-
registry: ghcr.io
67-
username: ${{ github.actor }}
68-
password: ${{ secrets.GITHUB_TOKEN }}
69-
70-
- name: Set up Docker Buildx
71-
timeout-minutes: 5
72-
uses: docker/setup-buildx-action@v2
73-
with:
74-
version: latest
75-
76-
- name: Set up Go
77-
uses: actions/setup-go@v5
78-
with:
79-
go-version-file: go.mod
80-
81-
- name: Build the ${{ github.repository }}
82-
run: |
83-
make reviewable
84-
make build-docker-binary
85-
86-
- name: Build and push Images
87-
run: |
88-
IMG=ghcr.io/openmcp-project/metrics-operator:${{ env.version }} make docker-buildx docker-push
89-
90-
- name: Package and push helm chart
91-
run: |
92-
make helm-package helm-push
93-
94-
- name: setup OCM
95-
uses: open-component-model/ocm-setup-action@main
96-
97-
- name: Create OCM CTF
98-
run: |
99-
ocm add componentversions --create \
100-
--file ctf component-constructor.yaml \
101-
--settings settings.yaml -- VERSION=${{ env.version }}
102-
103-
- name: Push CTF
104-
run: |
105-
ocm transfer ctf --overwrite ./ctf ${{ env.OCI_URL }}
13+
release_publish:
14+
uses: openmcp-project/build/.github/workflows/publish.lib.yaml@main
15+
secrets: inherit

.github/workflows/release.yaml

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -11,114 +11,5 @@ permissions:
1111

1212
jobs:
1313
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-
24-
- name: Read and validate VERSION
25-
id: version
26-
run: |
27-
VERSION=$(cat VERSION)
28-
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then
29-
echo "Invalid version format in VERSION file: $VERSION"
30-
exit 1
31-
fi
32-
echo "New version: $VERSION"
33-
echo "version=$VERSION" >> $GITHUB_ENV
34-
35-
- name: Skip release if version is a dev version
36-
if: contains(env.version, '-dev')
37-
run: |
38-
echo "Skipping development version release: ${{ env.version }}"
39-
echo "SKIP=true" >> $GITHUB_ENV
40-
exit 0
41-
42-
- name: Check if VERSION is already tagged
43-
id: check_tag
44-
run: |
45-
if git rev-parse "refs/tags/${{ env.version }}" >/dev/null 2>&1; then
46-
echo "Tag ${{ env.version }} already exists. Skipping release."
47-
echo "SKIP=true" >> $GITHUB_ENV
48-
exit 0
49-
fi
50-
echo "Tag ${{ env.version }} doesn't exists. Proceeding with release."
51-
52-
- name: Create Git tag
53-
if: ${{ env.SKIP != 'true' }}
54-
run: |
55-
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
56-
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
57-
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
58-
59-
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
60-
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
61-
62-
git config user.name "$AUTHOR_NAME"
63-
git config user.email "$AUTHOR_EMAIL"
64-
65-
git tag -a "${{ env.version }}" -m "Release ${{ env.version }}"
66-
git push origin "${{ env.version }}"
67-
68-
- name: Build Changelog
69-
id: github_release
70-
71-
uses: mikepenz/release-changelog-builder-action@v5
72-
with:
73-
mode: "PR"
74-
configurationJson: |
75-
{
76-
"template": "#{{CHANGELOG}}",
77-
"pr_template": "- #{{TITLE}}: ##{{NUMBER}}",
78-
"categories": [
79-
{
80-
"title": "## Feature",
81-
"labels": ["feat", "feature"]
82-
},
83-
{
84-
"title": "## Fix",
85-
"labels": ["fix", "bug"]
86-
},
87-
{
88-
"title": "## Other",
89-
"labels": []
90-
}
91-
],
92-
"label_extractor": [
93-
{
94-
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
95-
"on_property": "title",
96-
"target": "$1"
97-
}
98-
]
99-
}
100-
env:
101-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102-
103-
- name: Create GitHub release
104-
if: ${{ env.SKIP != 'true' }}
105-
uses: softprops/action-gh-release@v2
106-
with:
107-
tag_name: ${{ env.version }}
108-
name: Release ${{ env.version }}
109-
body: ${{steps.github_release.outputs.changelog}}
110-
draft: true
111-
prerelease: false
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114-
115-
- name: Push dev VERSION
116-
if: ${{ env.SKIP != 'true' }}
117-
run: |
118-
echo "${{ env.version }}-dev" > VERSION
119-
make helm-chart
120-
git config user.name "${{ env.AUTHOR_NAME }}"
121-
git config user.email "${{ env.AUTHOR_EMAIL }}"
122-
git add VERSION charts/metrics-operator/Chart.yaml charts/metrics-operator/values.yaml
123-
git commit -m "chore: update VERSION to ${{ env.version }}-dev"
124-
git push origin main
14+
uses: openmcp-project/build/.github/workflows/release.lib.yaml@main
15+
secrets: inherit

.github/workflows/reuse-scan.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.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+
permissions:
6+
contents: read
7+
8+
jobs:
9+
run_reuse:
10+
uses: openmcp-project/build/.github/workflows/reuse.lib.yaml@main
11+
secrets: inherit

.github/workflows/reviewable.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.
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

.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

0 commit comments

Comments
 (0)