test package building to test-pypi #48
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository π | |
uses: actions/checkout@v4 | |
- name: Update version in pyproject.toml β¬οΈ | |
uses: brettdorrans/[email protected] | |
with: | |
filename: 'pyproject.toml' | |
placeholder: '1.0.0.dev1' | |
- 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 }} | |
- name: Publish package to TestPyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ |