Skip to content

Release

Release #25

Workflow file for this run

# Release builds and publish a new release.
# It will run necessary tests. Then it builds the docker image, pushes it to the container registry, and creates a new Github Release (and git tag) with automated release notes (automated release notes powered by GitHub).
name: Release
on:
workflow_dispatch:
inputs:
nextVersion:
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
permissions:
contents: read
env:
REGISTRY: ghcr.io/openmcp-project
IMAGE_NAME: mcp-ui-frontend
jobs:
run-build:
uses: ./.github/workflows/build.yaml
release:
runs-on: ubuntu-latest
needs:
- run-build
permissions:
contents: write # write release tag to the repo
packages: write # push the container to ghcr
steps:
- name: Checkout code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Check if tag already exists
id: check_tag
run: |
if git rev-parse ${{ github.event.inputs.nextVersion }} >/dev/null 2>&1
then
echo "Tag ${{ github.event.inputs.nextVersion }} already exists."
exit 1
else
echo "Tag does not exit. Building release version ${{ github.event.inputs.nextVersion }}"
fi
- name: Log in to the Container registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build and push Docker image
id: push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: "linux/amd64,linux/arm64"
push: true
sbom: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }}
- 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
env:
OCM_COMPONENT_VERSION: ${{ 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 }}
run: |
gh release create ${{ github.event.inputs.nextVersion }} \
--generate-notes \
--target ${{ github.sha }}