Skip to content

chore(release): bump version to 0.5.0 #69

chore(release): bump version to 0.5.0

chore(release): bump version to 0.5.0 #69

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
env:
PYTHON_VERSION: "3.13"
REGISTRY: ghcr.io
IMAGE_NAME: othervibes/mcp-as-a-judge
jobs:
build_dist:
name: Build sdist/wheel and verify version
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v6
with:
version: latest
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Extract version from tag
id: ver
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Verify version matches pyproject.toml
run: |
PROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
test "$PROJECT_VERSION" = "${{ steps.ver.outputs.VERSION }}"
- name: Clean dist directory
run: rm -rf dist/
- name: Build package
run: uv build
- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
publish_pypi:
name: Publish to PyPI
needs: build_dist
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v5
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
docker_build_push:
name: Build & push multi-arch image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v5
- name: Extract version from tag
id: ver
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ steps.ver.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
create_release:
name: Create GitHub Release with artifacts
needs: build_dist
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Generate changelog
run: |
echo "## What's Changed" > CHANGELOG.md
echo "" >> CHANGELOG.md
git log --oneline --pretty=format:"* %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD >> CHANGELOG.md || echo "* Initial release" >> CHANGELOG.md
- uses: actions/download-artifact@v5
with:
name: dist
path: dist
- uses: softprops/action-gh-release@v2
with:
files: dist/*
body_path: CHANGELOG.md
generate_release_notes: true
publish_mcp_registry:
name: Publish to MCP Registry (preview)
needs: [publish_pypi]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
continue-on-error: true
steps:
- uses: actions/checkout@v5
- name: Extract version from tag
id: ver
run: |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Extract project metadata
id: metadata
env:
VERSION: ${{ steps.ver.outputs.VERSION }}
run: |
python - <<'PY'
import tomllib, os
VERSION = os.environ['VERSION']
with open('pyproject.toml','rb') as f:
data = tomllib.load(f)
project = data['project']
# Extract metadata for the action
name = f"io.github.OtherVibes/{project['name']}"
description = project['description']
homepage = next((url[1] for url in project.get('urls', {}).items() if url[0] == 'Homepage'), '')
package_name = project['name']
# Write to GitHub outputs
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write(f"name={name}\n")
f.write(f"description={description}\n")
f.write(f"homepage={homepage}\n")
f.write(f"package_name={package_name}\n")
PY
- name: Publish to MCP Registry
uses: OtherVibes/mcp-publish-action@v1
with:
name: ${{ steps.metadata.outputs.name }}
description: ${{ steps.metadata.outputs.description }}
version: ${{ steps.ver.outputs.VERSION }}
website_url: ${{ steps.metadata.outputs.homepage }}
registry_type: pypi
identifier: ${{ steps.metadata.outputs.package_name }}
package_version: ${{ steps.ver.outputs.VERSION }}
transport_type: stdio
verify: true