diff --git a/.github/workflows/test_pypi.yml b/.github/workflows/test_pypi.yml new file mode 100644 index 0000000..9271738 --- /dev/null +++ b/.github/workflows/test_pypi.yml @@ -0,0 +1,55 @@ +name: Build and upload to test PyPI + +on: + workflow_dispatch: + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - name: Build wheels + run: | + pip wheel -w wheelhouse . + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + user: __token__ + password: ${{ secrets.test_pypi_password }} + skip-existing: true + verbose: true \ No newline at end of file