Skip to content

Commit 497e89a

Browse files
committed
add extra steps to release
1 parent 82847c1 commit 497e89a

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

.github/workflows/wheels.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
# Adapted from:
33
# https://github.com/pypa/cibuildwheel?tab=readme-ov-file#example-setup
4+
# https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
45
name: Spark-DSG Wheels
5-
on: {release: {types: [published]}}
6+
on: {workflow_dispatch: {}, push: {branches: {main}} release: {types: [published]}}
67
jobs:
78
build_wheels:
89
name: Build wheels on ${{ matrix.os }}
@@ -11,7 +12,7 @@ jobs:
1112
matrix:
1213
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
1314
steps:
14-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1516
- uses: actions/setup-python@v5
1617
- name: Install cibuildwheel
1718
run: python -m pip install cibuildwheel
@@ -21,3 +22,31 @@ jobs:
2122
with:
2223
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
2324
path: ./wheelhouse/*.whl
25+
build_sdist:
26+
name: Build source distribution
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v5
30+
- name: Build sdist
31+
run: pipx run build --sdist
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: cibw-sdist
35+
path: dist/*.tar.gz
36+
upload_pypi:
37+
needs: [build_wheels, build_sdist]
38+
runs-on: ubuntu-latest
39+
environment: pypi
40+
permissions:
41+
id-token: write
42+
if: github.event_name == 'release' && github.event.action == 'published'
43+
steps:
44+
- uses: actions/download-artifact@v5
45+
with:
46+
pattern: cibw-*
47+
path: dist
48+
merge-multiple: true
49+
#- uses: pypa/gh-action-pypi-publish@release/v1
50+
# To test uploads to TestPyPI, uncomment the following:
51+
# with:
52+
# repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)