Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Publish Python Package to PyPI #9

Publish Python Package to PyPI

Publish Python Package to PyPI #9

name: Publish Python Package to PyPI
on:
release:
types: [created]
workflow_run:
workflows: ["Bump Version"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'release' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')) && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || 'main' }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install uv twine toml
- name: Build package
run: |
rm -rf dist/
uv build --no-sources
- name: Check distribution with twine
run: |
twine check dist/*
- name: Publish to PyPI
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/* -u __token__ -p $PYPI_API_TOKEN
- name: Extract package version
id: get_version
run: |
PACKAGE_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
- name: Notify Slack about PyPI release
id: slack
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: |
:rocket: *New Release Published to PyPI!*
*Package:* codelogic-mcp-server v${{ steps.get_version.outputs.version }}
*Published by:* ${{ github.actor }}
:link: <https://pypi.org/project/codelogic-mcp-server/${{ steps.get_version.outputs.version }}|View on PyPI>
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.