Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ jobs:
sbom: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }}

- name: Install OCM CLI
run: |
sudo curl -sL https://raw.githubusercontent.com/open-component-model/ocm/main/install.sh | sudo bash

- name: Install Go-Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build OCM component
run: task build:ocm -- ${{ github.event.inputs.nextVersion }}

- name: Publish OCM component
run: task publish:ocm

- name: Create Release with autogenerated release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ public/frontend-config.json

# Sentry Config File
.env.sentry-build-plugin

# OCM build artifacts
.ctf/
54 changes: 54 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
version: "3"

vars:
# Variables for Docker image
REGISTRY: {{.REGISTRY | default (print "ghcr.io/openmcp-project") }}
IMAGE_NAME: mcp-ui-frontend
IMAGE_TAG: '{{.TAG | default "latest"}}'
DOCKER_IMAGE: "{{.REGISTRY}}/{{.IMAGE_NAME}}:{{.IMAGE_TAG}}"

# Variables for OCM component
OCM_COMPONENT_NAME: github.com/openmcp-project/ui
OCM_COMPONENT_VERSION: '{{.OCM_COMPONENT_VERSION | default .IMAGE_TAG}}'
OCM_PROVIDER: openmcp-project
OCM_TARGET_REPO: '{{.OCM_TARGET_REPO | default (print .REGISTRY "/components") }}'
OCM_OUTPUT_DIR: "{{.ROOT_DIR}}/.ctf"
OCM_DESCRIPTOR: "{{.ROOT_DIR}}/ocm/component-descriptor.yaml"

tasks:
default:
desc: Show available tasks
cmds:
- task --list

build:ocm:
desc: "Builds the ocm component. Usage: task build:ocm -- <version>"
cmds:
- rm -rf {{.OCM_OUTPUT_DIR}}
- |
ocm add components --create \
--lookup {{.OCM_TARGET_REPO}} \
--file {{.OCM_OUTPUT_DIR}} \
{{.OCM_DESCRIPTOR}} -- \
VERSION={{.OCM_COMPONENT_VERSION}} \
COMPONENT_NAME={{.OCM_COMPONENT_NAME}} \
PROVIDER={{.OCM_PROVIDER}}
vars:
OCM_COMPONENT_VERSION: '{{.CLI_ARGS}}'

publish:ocm:
desc: "Publishes the ocm component to the registry."
cmds:
- |
ocm transfer ctf \
{{.OCM_OUTPUT_DIR}} {{.OCM_TARGET_REPO}}

build:image:local:
desc: "Builds the docker image for local testing. Usage: task test:build-image TAG=v-local-test"
cmds:
- docker build -t {{.DOCKER_IMAGE}} .

publish:image:local:
desc: "Publishes the docker image for local testing. Usage: task test:publish-image TAG=v-local-test"
cmds:
- docker push {{.DOCKER_IMAGE}}
13 changes: 13 additions & 0 deletions ocm/component-descriptor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: ${COMPONENT_NAME}
version: ${VERSION}
provider:
name: ${PROVIDER}
sources: []
componentReferences: []
resources:
- name: mcp-ui-frontend-image
type: ociImage
version: ${VERSION}
access:
type: ociArtifact
imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${VERSION}
Loading