Skip to content

Commit

Permalink
chore: Add release stage
Browse files Browse the repository at this point in the history
A release stage has been added according to
https://cibuildwheel.pypa.io/en/stable/deliver-to-pypi/
  • Loading branch information
Kolarovszki committed Nov 1, 2024
1 parent 2019f83 commit 0b7ceb0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build SDist and wheels

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -17,6 +18,10 @@ on:
- '**/CMakeLists.txt'
- '.github/workflows/**'

release:
types:
- published

jobs:
build_sdist:
name: Build SDist
Expand Down Expand Up @@ -81,3 +86,22 @@ jobs:
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

# See: https://cibuildwheel.pypa.io/en/stable/deliver-to-pypi/
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

0 comments on commit 0b7ceb0

Please sign in to comment.