Skip to content

Release

Release #17

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
repository:
description: The index repository to publish to - PyPI or Test PyPI
required: true
default: pypi
type: choice
options:
- pypi
- test-pypi
jobs:
release:
runs-on: ubuntu-latest
env:
PYPI_PUBLISH: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Poetry
run: pipx install --pip-args="-c .github/workflows/poetry-constraint.txt" poetry
- uses: actions/setup-python@v4
with:
python-version-file: .python-version
- name: Install the dynamic versioning plugin
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build and publish the package (test PyPI)
if: inputs.repository == 'test-pypi'
env:
POETRY_PYPI_TOKEN_TEST_PYPI: ${{ secrets.TEST_PYPI_TOKEN }}
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry publish --build --repository test-pypi
- name: Build and publish the package (PyPI)
if: inputs.repository == 'pypi'
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
- name: Upload source and wheel distributions
uses: actions/upload-artifact@v3
with:
name: python-build-archives
path: dist/