PyPI #3
Workflow file for this run
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: PyPI | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- '!v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
jobs: | |
build-and-publish: | |
name: Build and publish to PyPI | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install twine | |
run: | | |
pip install --upgrade pip wheel setuptools | |
pip install twine | |
python --version | |
pip --version | |
twine --version | |
- name: Create source distribution | |
run: | | |
python setup.py sdist --dist-dir wheelhouse | |
- name: Upload source distribution | |
run: | | |
twine upload --skip-existing wheelhouse/*.tar.gz |