From fd074d21cd3fdd8cad64fb7b6252f6541f8c73e3 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Tue, 26 Jul 2022 17:08:57 +0100 Subject: [PATCH 1/2] Add a github workflow that publishes to sdists to PyPI on release. --- .github/workflows/publish-on-pypi.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/publish-on-pypi.yml diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml new file mode 100644 index 000000000..868abb936 --- /dev/null +++ b/.github/workflows/publish-on-pypi.yml @@ -0,0 +1,37 @@ +name: Publish release to PyPI + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build-and-upload: + runs-on: ubuntu-latest + + steps: + - name: Check out the release commit + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install Python packages needed for build and upload + run: | + python -m pip install build twine + + - name: Build sdist and wheel + run: | + python setup.py sdist + + - name: Publish to PyPI + + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + + run: | + python -m twine check --strict dist/* + python -m twine upload dist/* From 2daffaf69f4006a25036b446c80d62c47b2476c5 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Thu, 4 Aug 2022 09:51:45 +0100 Subject: [PATCH 2/2] Use build to build the sdist. --- .github/workflows/publish-on-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml index 868abb936..72ca43a89 100644 --- a/.github/workflows/publish-on-pypi.yml +++ b/.github/workflows/publish-on-pypi.yml @@ -22,9 +22,9 @@ jobs: run: | python -m pip install build twine - - name: Build sdist and wheel + - name: Build sdist run: | - python setup.py sdist + python -m build --sdist - name: Publish to PyPI