diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..26666d3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,52 @@ +name: Build wheels and sdist and upload everything to testPyPI + +on: + release: + types: [published] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-2019] + + steps: + - uses: actions/checkout@v3 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.12.1 + + - 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 + + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_PYSNDBXBNJMNP_ACCESS_TOKEN }} + repository_url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 051227b..daa3e16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,4 +20,8 @@ dynamic = ["version"] where = ["src"] [tool.setuptools.dynamic] -version = {attr = "pysndbxbnjmnp.__version__"} \ No newline at end of file +version = {attr = "pysndbxbnjmnp.__version__"} + +# Limit the created wheels for windows to AMD64. +[tool.cibuildwheel.windows] +archs = ["AMD64"] \ No newline at end of file