From 11ea93da5b39776a0f1a6479c74d5dc4f0bc2df4 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:46:37 -0400 Subject: [PATCH] CI/CD: Add step to publish wheels on tag creation --- .github/workflows/python-package.yml | 27 +++++++++++++++++++++++++++ .github/workflows/upload_pypi.yml | 0 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/upload_pypi.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 241f90fca..b7414d4af 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -18,6 +18,7 @@ on: release: types: [published] workflow_dispatch: {} # Allow manual trigger + workflow_call: {} # Allow triggering from other worfkflows concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -221,6 +222,32 @@ jobs: - run: pip install auditwheel - run: python ./.github/scripts/auditwheel_show.py wheels/* | tee $GITHUB_STEP_SUMMARY + publish-wheels: + name: Publish wheels to Test PyPI + needs: [build-wheels, audit-wheels] + runs-on: ubuntu-latest + if: | + github.repository == 'bitsandbytes-foundation/bitsandbytes' + && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + environment: + name: release + url: https://test.pypi.org/p/bitsandbytes + permissions: + id-token: write + steps: + - name: Download distribution artifacts + uses: actions/download-artifact@v4 + with: + path: dist/ + pattern: "bdist_wheel_*" + merge-multiple: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true + repository-url: https://test.pypi.org/legacy/ + # test: # needs: # - build-wheels diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml new file mode 100644 index 000000000..e69de29bb