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
9 changes: 9 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,12 @@ jobs:
annotations: ${{ steps.meta.outputs.annotations }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build OCM component
run: task build:ocm
env:
IMAGE_VERSION: "main"
OCM_COMPONENT_VERSION: "v0.0.0-main"

- name: Publish OCM component
run: task publish:ocm
6 changes: 4 additions & 2 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
inputs:
nextVersion:
description: 'specify the release version in the semver format v[major].[minor].[patch] e.g. v0.0.0'
description: "specify the release version in the semver format v[major].[minor].[patch] e.g. v0.0.0"
required: true

# base permissions for all jobs should be minimal
Expand Down Expand Up @@ -82,7 +82,9 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Publish OCM component
run: task publish:ocm
Expand Down
23 changes: 12 additions & 11 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: "3"
version: '3'

vars:
# Variables for Docker image
REGISTRY: {{.REGISTRY | default (print "ghcr.io/openmcp-project") }}
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}}"
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"
OCM_OUTPUT_DIR: '{{.ROOT_DIR}}/.ctf'
OCM_DESCRIPTOR: '{{.ROOT_DIR}}/ocm/component-descriptor.yaml'

tasks:
default:
Expand All @@ -22,7 +22,7 @@ tasks:
- task --list

build:ocm:
desc: "Builds the ocm component. Usage: task build:ocm -- <version>"
desc: 'Builds the ocm component. Usage: task build:ocm'
cmds:
- rm -rf {{.OCM_OUTPUT_DIR}}
- |
Expand All @@ -31,24 +31,25 @@ tasks:
--file {{.OCM_OUTPUT_DIR}} \
{{.OCM_DESCRIPTOR}} -- \
VERSION={{.OCM_COMPONENT_VERSION}} \
IMAGE_VERSION={{.IMAGE_VERSION}} \
COMPONENT_NAME={{.OCM_COMPONENT_NAME}} \
PROVIDER={{.OCM_PROVIDER}}
vars:
OCM_COMPONENT_VERSION: '{{.CLI_ARGS}}'
IMAGE_VERSION: '{{.IMAGE_VERSION | default (print .OCM_COMPONENT_VERSION)}}'

publish:ocm:
desc: "Publishes the ocm component to the registry."
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"
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"
desc: 'Publishes the docker image for local testing. Usage: task test:publish-image TAG=v-local-test'
cmds:
- docker push {{.DOCKER_IMAGE}}
- docker push {{.DOCKER_IMAGE}}
2 changes: 1 addition & 1 deletion ocm/component-descriptor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ resources:
version: ${VERSION}
access:
type: ociArtifact
imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${VERSION}
imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${IMAGE_VERSION}
Loading