diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 46bdab37..4e9847cd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-release.yaml index ff5f7a42..9ad86f28 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/on-release.yaml @@ -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 @@ -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 diff --git a/Taskfile.yml b/Taskfile.yml index 97fb7e37..b395f4d9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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: @@ -22,7 +22,7 @@ tasks: - task --list build:ocm: - desc: "Builds the ocm component. Usage: task build:ocm -- " + desc: 'Builds the ocm component. Usage: task build:ocm' cmds: - rm -rf {{.OCM_OUTPUT_DIR}} - | @@ -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}} \ No newline at end of file + - docker push {{.DOCKER_IMAGE}} diff --git a/ocm/component-descriptor.yaml b/ocm/component-descriptor.yaml index 59c09165..1514f6be 100644 --- a/ocm/component-descriptor.yaml +++ b/ocm/component-descriptor.yaml @@ -10,4 +10,4 @@ resources: version: ${VERSION} access: type: ociArtifact - imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${VERSION} \ No newline at end of file + imageReference: ghcr.io/openmcp-project/mcp-ui-frontend:${IMAGE_VERSION}