Skip to content

Commit c17e034

Browse files
chore: Use shared Task definitions (#36)
* remove old files * Use common task definitions * update actions * Update Taskfile.yaml Co-authored-by: Johannes Aubart <[email protected]> * review comments --------- Co-authored-by: Johannes Aubart <[email protected]>
1 parent 6006c0b commit c17e034

35 files changed

+83
-1223
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,27 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
1821

1922
- name: Set up Go
2023
uses: actions/setup-go@v5
2124
with:
2225
go-version-file: go.mod
2326

24-
- name: make tidy
27+
- name: Install Task
28+
uses: arduino/setup-task@v2
29+
with:
30+
version: 3.x
31+
32+
- name: make generate
2533
run: |
26-
27-
make tidy
34+
task generate
2835
git diff --exit-code
2936
30-
- name: make verify
31-
run: make verify
37+
- name: task validate
38+
run: task validate
3239

33-
- name: make test
34-
run: make test
40+
- name: task test
41+
run: task test

.github/workflows/publish.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ jobs:
2222
ssh-key: ${{ secrets.PUSH_KEY }}
2323
fetch-tags: true
2424
fetch-depth: 0
25+
submodules: recursive
26+
27+
- name: Install Task
28+
uses: arduino/setup-task@v2
29+
with:
30+
version: 3.x
2531

2632
- name: Read and validate VERSION
2733
id: version
2834
run: |
29-
VERSION=$(cat VERSION)
35+
VERSION=$(task version)
3036
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then
3137
echo "Invalid version format in VERSION file: $VERSION"
3238
exit 1
@@ -67,24 +73,14 @@ jobs:
6773
with:
6874
go-version-file: go.mod
6975

70-
- name: Build the ${{ github.repository }}
76+
- name: Build and Push Images
7177
run: |
72-
make prepare-release
73-
make build
74-
75-
- name: Build Images
76-
run: |
77-
IMAGE_REGISTRY=ghcr.io/openmcp-project make image-build
78-
79-
- name: setup OCM
80-
uses: open-component-model/ocm-setup-action@main
78+
task build:img:all
8179
82-
- name: Create OCM CTF
80+
- name: Package and Push Helm Charts
8381
run: |
84-
ocm add componentversions --create \
85-
--file ctf component-constructor.yaml \
86-
--settings settings.yaml -- VERSION=${{ env.version }}
82+
task build:helm:all
8783
88-
- name: Push CTF
84+
- name: Build and Push OCM Component
8985
run: |
90-
ocm transfer ctf --overwrite ./ctf ${{ env.OCI_URL }}
86+
task build:ocm:all

.github/workflows/release.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ jobs:
1919
ssh-key: ${{ secrets.PUSH_KEY }}
2020
fetch-tags: true
2121
fetch-depth: 0
22+
submodules: recursive
23+
24+
- name: Install Task
25+
uses: arduino/setup-task@v2
26+
with:
27+
version: 3.x
2228

2329
- name: Read and validate VERSION
2430
id: version
2531
run: |
26-
VERSION=$(cat VERSION)
32+
VERSION=$(task version)
2733
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-dev)?$ ]]; then
2834
echo "Invalid version format in VERSION file: $VERSION"
2935
exit 1
@@ -97,6 +103,22 @@ jobs:
97103
}
98104
env:
99105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
107+
- name: Create Git tag for api submodule
108+
if: ${{ env.SKIP != 'true' }}
109+
run: |
110+
AUTHOR_NAME=$(git log -1 --pretty=format:'%an')
111+
AUTHOR_EMAIL=$(git log -1 --pretty=format:'%ae')
112+
echo "Tagging as $AUTHOR_NAME <$AUTHOR_EMAIL>"
113+
114+
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_ENV
115+
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_ENV
116+
117+
git config user.name "$AUTHOR_NAME"
118+
git config user.email "$AUTHOR_EMAIL"
119+
120+
git tag -a "api/${{ env.version }}" -m "Release ${{ env.version }}"
121+
git push origin "api/${{ env.version }}"
100122

101123
- name: Create GitHub release
102124
if: ${{ env.SKIP != 'true' }}
@@ -113,7 +135,7 @@ jobs:
113135
- name: Push dev VERSION
114136
if: ${{ env.SKIP != 'true' }}
115137
run: |
116-
echo "${{ env.version }}-dev" > VERSION
138+
task release:set-version -- "${{ env.version }}-dev"
117139
git config user.name "${{ env.AUTHOR_NAME }}"
118140
git config user.email "${{ env.AUTHOR_EMAIL }}"
119141
git add VERSION

.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

Makefile

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

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hack/common/Makefile

0 commit comments

Comments
 (0)