From a31a6a2d9fb86720258dcde391d75bfac010a0de Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 4 Nov 2020 22:24:07 -0500 Subject: [PATCH] Migrate PyPI release to GitHub Actions --- .github/workflows/publish-to-pypi.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000000..82e41579146 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,32 @@ +name: Publish to PyPI + +on: push + +jobs: + publish-pypi: + name: Publish to PyPI + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Build source distributions and wheels + run: python setup.py bdist_wheel + + - name: Publish to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }}