Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Install uv
uses: astral-sh/setup-uv@v4
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches: [main]
release:
types: [published]
workflow_call:
inputs:
tag:
description: "Release tag to build (e.g. v0.2.0)"
required: true
type: string

concurrency:
group: docker-${{ github.ref }}
Expand All @@ -21,7 +27,10 @@ jobs:
attestations: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Publish to PyPI
on:
release:
types: [published]
workflow_call:
inputs:
tag:
description: "Release tag to publish (e.g. v0.2.0)"
required: true
type: string

jobs:
publish:
Expand All @@ -14,14 +20,18 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Sync versions to release tag
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
VERSION="${{ inputs.tag || github.ref_name }}"
VERSION="${VERSION#v}"
# Update pyproject.toml version (what PyPI publishes)
sed -i -E "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
# Update server.json version (what MCP Registry records)
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ permissions:
jobs:
tag-and-release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.ver.outputs.tag }}
steps:
- name: Ensure release runs from main
if: github.ref != 'refs/heads/main'
run: |
echo "Releases must be cut from the main branch."
exit 1

- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
fetch-depth: 0 # need tags to find the latest

Expand All @@ -46,3 +48,28 @@ jobs:
gh release create "${{ steps.ver.outputs.tag }}" \
--title "${{ steps.ver.outputs.tag }}" \
--generate-notes

# Call the reusable publish/docker workflows directly rather than relying on
# the release event: GITHUB_TOKEN-created releases do not emit events, so
# downstream 'on: release' triggers would never fire.
publish:
needs: tag-and-release
uses: ./.github/workflows/publish.yml
with:
tag: ${{ needs.tag-and-release.outputs.tag }}
secrets: inherit
permissions:
contents: read
id-token: write # PyPI trusted publishing + MCP Registry github-oidc

docker:
needs: tag-and-release
uses: ./.github/workflows/docker.yml
with:
tag: ${{ needs.tag-and-release.outputs.tag }}
secrets: inherit
permissions:
contents: read
packages: write
id-token: write
attestations: write
Loading