Skip to content

Commit

Permalink
CI/CD: Add step to publish wheels on tag creation
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdouglas committed Sep 23, 2024
1 parent e7c6fc6 commit 11ea93d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
Empty file.

0 comments on commit 11ea93d

Please sign in to comment.