2023-04-10 02:38:19 +00:00
|
|
|
name: Publish to PyPI
|
2023-04-10 02:32:30 +00:00
|
|
|
|
|
|
|
# Based on: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-n-publish:
|
|
|
|
name: Build and publish
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2024-04-30 02:52:23 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-04-10 04:51:25 +00:00
|
|
|
with:
|
2024-02-14 04:53:56 +00:00
|
|
|
submodules: "recursive"
|
2023-04-10 02:32:30 +00:00
|
|
|
- name: Set up Python
|
2024-04-30 02:52:23 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-04-10 02:32:30 +00:00
|
|
|
with:
|
2024-06-13 14:19:57 +00:00
|
|
|
python-version: "3.9"
|
2023-04-10 02:32:30 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-06-13 14:19:57 +00:00
|
|
|
python -m pip install --upgrade pip build
|
|
|
|
python -m pip install -e .[all]
|
2023-04-10 02:32:30 +00:00
|
|
|
- name: Build source distribution
|
|
|
|
run: |
|
2024-06-13 14:19:57 +00:00
|
|
|
python -m build --sdist
|
2023-04-10 02:32:30 +00:00
|
|
|
- name: Publish distribution to PyPI
|
|
|
|
# TODO: move to tag based releases
|
|
|
|
# if: startsWith(github.ref, 'refs/tags')
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
2023-04-12 09:53:39 +00:00
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|