|
name: Publishing |
|
|
|
on: |
|
release: |
|
types: [published] |
|
|
|
permissions: |
|
contents: read |
|
|
|
jobs: |
|
release-build: |
|
name: Build distribution |
|
runs-on: ubuntu-latest |
|
needs: [checks] |
|
steps: |
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
|
with: |
|
persist-credentials: false |
|
|
|
- name: Install uv |
|
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 |
|
with: |
|
enable-cache: false |
|
version: 0.12.5 |
|
|
|
- name: Set up Python 3.12 |
|
run: uv python install 3.12 |
|
|
|
- name: Build |
|
run: | |
|
uv build --package mcp |
|
uv build --package mcp-types |
|
|
|
- name: Upload artifacts |
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
|
with: |
|
name: release-dists |
|
path: dist/ |
|
|
|
checks: |
|
uses: ./.github/workflows/shared.yml |
|
|
|
pypi-publish: |
|
name: Upload release to PyPI |
|
runs-on: ubuntu-latest |
|
environment: release |
|
needs: |
|
- release-build |
|
permissions: |
|
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing |
|
|
|
steps: |
|
- name: Retrieve release distributions |
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
|
with: |
|
name: release-dists |
|
path: dist/ |
|
|
|
- name: Publish package distributions to PyPI |
|
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |
|
with: |
|
# Lets a re-run after a partially failed upload publish the remaining |
|
# files instead of erroring on the ones already on PyPI. |
|
skip-existing: true |