Skip to content

Commit c6ecfcf

Browse files
feat: com package build
1 parent 9e1580a commit c6ecfcf

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed

.github/workflows/on-release.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,22 @@ jobs:
7171
sbom: true
7272
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }}
7373

74+
- name: Install OCM CLI
75+
run: |
76+
sudo curl -sL https://raw.githubusercontent.com/open-component-model/ocm/main/install.sh | sudo bash
77+
78+
- name: Install Go-Task
79+
uses: arduino/setup-task@v2
80+
with:
81+
version: 3.x
82+
repo-token: ${{ secrets.GITHUB_TOKEN }}
83+
84+
- name: Build OCM component
85+
run: task build:ocm -- ${{ github.event.inputs.nextVersion }}
86+
87+
- name: Publish OCM component
88+
run: task publish:ocm
89+
7490
- name: Create Release with autogenerated release notes
7591
env:
7692
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ public/frontend-config.json
3333

3434
# Sentry Config File
3535
.env.sentry-build-plugin
36+
37+
# OCM build artifacts
38+
.ctf/

Taskfile.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: "3"
2+
3+
vars:
4+
# Variables for Docker image
5+
REGISTRY: {{.REGISTRY | default (print "ghcr.io/openmcp-project") }}
6+
IMAGE_NAME: mcp-ui-frontend
7+
IMAGE_TAG: '{{.TAG | default "latest"}}'
8+
DOCKER_IMAGE: "{{.REGISTRY}}/{{.IMAGE_NAME}}:{{.IMAGE_TAG}}"
9+
10+
# Variables for OCM component
11+
OCM_COMPONENT_NAME: github.com/openmcp-project/ui
12+
OCM_COMPONENT_VERSION: '{{.OCM_COMPONENT_VERSION | default .IMAGE_TAG}}'
13+
OCM_PROVIDER: openmcp-project
14+
OCM_TARGET_REPO: '{{.OCM_TARGET_REPO | default (print .REGISTRY "/components") }}'
15+
OCM_OUTPUT_DIR: "{{.ROOT_DIR}}/.ctf"
16+
OCM_DESCRIPTOR: "{{.ROOT_DIR}}/ocm/component-descriptor.yaml"
17+
18+
tasks:
19+
default:
20+
desc: Show available tasks
21+
cmds:
22+
- task --list
23+
24+
build:ocm:
25+
desc: "Builds the ocm component. Usage: task build:ocm -- <version>"
26+
cmds:
27+
- rm -rf {{.OCM_OUTPUT_DIR}}
28+
- |
29+
ocm add components --create \
30+
--lookup {{.OCM_TARGET_REPO}} \
31+
--file {{.OCM_OUTPUT_DIR}} \
32+
{{.OCM_DESCRIPTOR}} -- \
33+
VERSION={{.OCM_COMPONENT_VERSION}} \
34+
COMPONENT_NAME={{.OCM_COMPONENT_NAME}} \
35+
PROVIDER={{.OCM_PROVIDER}}
36+
vars:
37+
OCM_COMPONENT_VERSION: '{{.CLI_ARGS}}'
38+
39+
publish:ocm:
40+
desc: "Publishes the ocm component to the registry."
41+
cmds:
42+
- |
43+
ocm transfer ctf \
44+
{{.OCM_OUTPUT_DIR}} {{.OCM_TARGET_REPO}}
45+
46+
build:image:local:
47+
desc: "Builds the docker image for local testing. Usage: task test:build-image TAG=v-local-test"
48+
cmds:
49+
- docker build -t {{.DOCKER_IMAGE}} .
50+
51+
publish:image:local:
52+
desc: "Publishes the docker image for local testing. Usage: task test:publish-image TAG=v-local-test"
53+
cmds:
54+
- docker push {{.DOCKER_IMAGE}}

ocm/component-descriptor.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: ${COMPONENT_NAME}
2+
version: ${VERSION}
3+
provider:
4+
name: ${PROVIDER}
5+
sources: []
6+
componentReferences: []
7+
resources:
8+
- name: mcp-ui-frontend-image
9+
type: ociImage
10+
version: ${VERSION}
11+
access:
12+
type: ociArtifact
13+
imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${VERSION}

0 commit comments

Comments
 (0)