build-publish.yml: update to use poetry #42
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: Build and Publish Release via PyPi | |
on: push | |
jobs: | |
build-n-publish: | |
name: Build and publish Python π distributions π¦ to PyPI and TestPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code π | |
uses: actions/checkout@v4 | |
- name: Update version file β¬οΈ | |
uses: brettdorrans/[email protected] | |
with: | |
filename: '.VERSION' | |
placeholder: '${VERSION}' | |
- name: Set up Python 3.12 π | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install and configure Poetry π | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: false | |
- name: Build & Package project π· | |
run: poetry build | |
- name: Publish distribution π¦ to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |