2.2 KiB
2.2 KiB
Release Guide
This document describes how to release the package to PyPI.
Prerequisites
-
Install build tools:
pip install build twine -
Make sure you have PyPI credentials configured:
# Create ~/.pypirc or use environment variables # TWINE_USERNAME and TWINE_PASSWORD
Release Process
1. Update Version
Update the version in pyproject.toml:
version = "0.1.1" # Increment as needed
2. Build the Package
# Clean previous builds
rm -rf dist/ build/
# Build the package
python -m build
This creates:
dist/ilspy_mcp_server-X.X.X.tar.gz(source distribution)dist/ilspy_mcp_server-X.X.X-py3-none-any.whl(wheel)
3. Test the Build
Test the package locally:
pip install dist/ilspy_mcp_server-*.whl
4. Check the Package
twine check dist/*
5. Upload to Test PyPI (Optional)
twine upload --repository testpypi dist/*
Test installation from Test PyPI:
pip install --index-url https://test.pypi.org/simple/ ilspy-mcp-server
6. Upload to PyPI
twine upload dist/*
7. Verify Installation
pip install ilspy-mcp-server
Version Numbering
Follow Semantic Versioning:
MAJOR.MINOR.PATCH(e.g., 1.0.0)- Increment MAJOR for breaking changes
- Increment MINOR for new features
- Increment PATCH for bug fixes
Automation (Optional)
You can automate releases using GitHub Actions. Create .github/workflows/release.yml:
name: Release to PyPI
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
Then add your PyPI API token as a GitHub secret named PYPI_API_TOKEN.