From baa394491c8346cefa4e80cd8ecd5587eaafded8 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Sun, 9 Apr 2023 22:32:30 -0400 Subject: [PATCH] Add PyPI publish workflow --- .github/workflows/publish.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..52e30e1 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,29 @@ +name: Publish Python to PyPI + +# 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: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.8" + - name: Install dependencies + run: | + python -m pip install --upgrade pip pytest cmake scikit-build setuptools + - name: Build source distribution + run: | + python setup.py sdist + - 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: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file