Publish releases to PyPI #14
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 releases to PyPI | |
on: | |
workflow_run: | |
workflows: ["Check and create tag"] | |
types: | |
- completed | |
branches: | |
- master | |
jobs: | |
package_build: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
name: Build and publish to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/vswobbly | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install build setuptools twine | |
continue-on-error: false | |
- name: Build wheel and source distribution | |
run: | | |
python -m build --wheel --sdist --outdir dist/ | |
continue-on-error: false | |
- name: Check the output | |
run: | | |
python -m twine check --strict dist/* | |
continue-on-error: false | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |