Skip to content

Release

Release #15

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 #v3.6.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: 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 }}