Skip to content

Publish Python Package to PyPI #167

Publish Python Package to PyPI

Publish Python Package to PyPI #167

name: Publish Python Package to PyPI
on:
push:
tags:
- '*.*.*'
workflow_dispatch:
workflow_run:
workflows: ["Create git tag"]
types:
- completed
permissions:
contents: write
jobs:
build_and_publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Publish a new version
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.x
- name: Install Flit
run: |
python -m pip install --upgrade pip
pip install flit
- name: Checkout Repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Publish Package to PyPI🚀
env:
FLIT_USERNAME: '__token__'
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
run: |
flit publish