Publish Python Package to PyPI #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
name: Publish a new version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install Flit | |
run: | | |
python -m pip install --upgrade pip | |
pip install flit | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Publish Package to PyPI🚀 | |
env: | |
FLIT_USERNAME: '__token__' | |
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} | |
run: | | |
flit publish |