Skip to content

test package building to test-pypi #48

test package building to test-pypi

test package building to test-pypi #48

Workflow file for this run

---
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/