Skip to content

chore(release): v0.3.0 #11

chore(release): v0.3.0

chore(release): v0.3.0 #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
name: Build & Test
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Set up Python 3.13
run: uv python install 3.13
- name: Install dependencies
run: uv sync --dev
- name: Verify tag matches package version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PKG_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
echo "::error::Tag ${GITHUB_REF_NAME} does not match pyproject.toml version ${PKG_VERSION}"
exit 1
fi
SERVER_VERSION=$(uv run python -c "import json; print(json.load(open('server.json'))['version'])")
PACKAGE_VERSION=$(uv run python -c "import json; print(json.load(open('server.json'))['packages'][0]['version'])")
if [ "$TAG_VERSION" != "$SERVER_VERSION" ]; then
echo "::error::Tag ${GITHUB_REF_NAME} does not match server.json version ${SERVER_VERSION}"
exit 1
fi
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "::error::Tag ${GITHUB_REF_NAME} does not match server.json package version ${PACKAGE_VERSION}"
exit 1
fi
echo "Version check passed: ${PKG_VERSION}"
- name: Run linter
run: uv run ruff check src/ tests/
- name: Run type checker
run: uv run pyright src/
- name: Run tests
run: uv run pytest --tb=short -q
- name: Build package
run: uv build
- name: Verify wheel contents
run: |
uv run python -c "
import zipfile, glob, sys
wheels = glob.glob('dist/*.whl')
if not wheels:
print('No wheel found')
sys.exit(1)
with zipfile.ZipFile(wheels[0]) as zf:
names = zf.namelist()
if not any('synonyms.yaml' in n for n in names):
print('synonyms.yaml not found in wheel')
sys.exit(1)
print('Wheel contents OK')
"
- name: Upload dist artifacts
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
publish:
needs: build
runs-on: ubuntu-latest
name: Publish to PyPI
timeout-minutes: 10
environment: pypi
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v4
with:
subject-path: 'dist/*'
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
publish-mcp-registry:
needs: publish
runs-on: ubuntu-latest
name: Publish to MCP Registry
timeout-minutes: 10
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
- name: Install mcp-publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" \
| tar xz mcp-publisher
- name: Validate server.json
run: ./mcp-publisher validate server.json
- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc
- name: Publish to MCP Registry
run: ./mcp-publisher publish
github-release:
needs:
- publish
- publish-mcp-registry
runs-on: ubuntu-latest
name: Create GitHub Release
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
files: dist/*
generate_release_notes: true