Skip to content

Publish Python 🐍 distribution 📦 to PyPI #2

Publish Python 🐍 distribution 📦 to PyPI

Publish Python 🐍 distribution 📦 to PyPI #2

Workflow file for this run

name: Publish Python 🐍 distribution 📦 to PyPI
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./Server
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: true
cache-dependency-glob: "Server/uv.lock"
- name: Build a binary wheel and a source tarball
run: uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: Server/dist/
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mcpforunityserver
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1