.github/workflows/publish-package.yml
# This workflow publishes the package to pypi.
# For more details:
# https://docs.github.com/en/actions/guides/building-and-testing-python#publishing-to-package-registries
name: Publish
on:
release:
types: [created]
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/bayte
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
with:
# fetch all tags so `versioneer` can properly determine current version
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: python -m pip install -r requirements.txt .[dev]
- name: Build package
run: python -m build --wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1