From 5e1acc48ee2be0b451c34c086240341fef552778 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sat, 13 Feb 2021 20:57:52 -0500 Subject: [PATCH] add sdist + pypi publish actions --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89d1afa..5054f51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,3 +20,35 @@ jobs: - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl + + build_sdist: + name: Build sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.9 + - uses: Gr1N/setup-poetry@v4 + - run: poetry check + - run: poetry install + - run: poetry build --format sdist + - uses: actions/upload-artifacts@v2 + with: + path: ./dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + # To test: repository_url: https://test.pypi.org/legacy/