Release #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
permissions: | |
contents: read | |
env: | |
REGISTRY: ghcr.io/openmcp-project | |
IMAGE_NAME: mcp-ui-backend | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
attestations: write | |
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@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 #v3.10.0 | |
- name: Build and push | |
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 #v6.16.0 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
sbom: true | |
provenance: mode=max | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.nextVersion }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- 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 }} |