Skip to content

chore(release): bump version to 0.3.0 #41

chore(release): bump version to 0.3.0

chore(release): bump version to 0.3.0 #41

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
PYTHON_VERSION: "3.13"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
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 --no-sources
- 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@v4
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=semver,pattern={{major}}
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
id: changelog
run: |
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "## Changes in ${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^)..HEAD >> $GITHUB_OUTPUT || echo "- Initial release" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: softprops/action-gh-release@v2
with:
tag_name: ${GITHUB_REF#refs/tags/}
name: Release ${GITHUB_REF#refs/tags/}
body: ${{ steps.changelog.outputs.CHANGELOG }}
draft: false
prerelease: false
files: |
dist/*
generate_release_notes: true
publish_mcp_registry:
name: Publish to MCP Registry (preview)
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
continue-on-error: true
steps:
- uses: actions/checkout@v5
- name: Install MCP Publisher CLI
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
- name: Extract version from tag
id: ver
run: |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Generate server.json
env:
VERSION: ${{ steps.ver.outputs.VERSION }}
run: |
python - <<'PY'
import json, tomllib, os
VERSION = os.environ['VERSION']
with open('pyproject.toml','rb') as f:
proj = tomllib.load(f)['project']
desc = proj.get('description','')
data = {
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
"name": "io.github.othervibes/mcp-as-a-judge",
"description": desc,
"version": VERSION,
"packages": [
{"registry_type": "pypi", "identifier": "mcp-as-a-judge", "version": VERSION},
{"registry_type": "oci", "registry_base_url": "https://ghcr.io", "identifier": "othervibes/mcp-as-a-judge", "version": VERSION}
]
}
with open('server.json','w') as f: json.dump(data,f,indent=2)
PY
- name: Login to MCP Registry (GitHub OIDC)
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish
- name: Verify publication
env:
NAME: io.github.othervibes/mcp-as-a-judge
run: |
for i in {1..10}; do
sleep 3
curl -sf "https://registry.modelcontextprotocol.io/v0/servers?search=$NAME" -o out.json || true
python - <<'PY'
import json, sys, os
name = os.environ['NAME']
try:
data=json.load(open('out.json'))
except Exception:
sys.exit(1)
items = []
if isinstance(data, dict):
items = data.get('results') or data.get('servers') or data.get('data') or []
elif isinstance(data, list):
items = data
ok = any(isinstance(s, dict) and s.get('name') == name for s in items)
sys.exit(0 if ok else 1)
PY
if [ $? -eq 0 ]; then echo "Verified $NAME in registry"; exit 0; fi
done
echo "Server not visible in registry yet"
exit 1