Skip to content

Commit e8bf20a

Browse files
ci: build binary wheels for windows and linux
1 parent 755ce43 commit e8bf20a

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

.github/workflows/wheels.yml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,69 @@ jobs:
4242
uses: actions/upload-artifact@v4
4343
with:
4444
name: dist-sdist
45-
path: ${{github.workspace}}/lang/python/dist/*.tar.gz
45+
path: '${{github.workspace}}/lang/python/dist/*.tar.gz'
46+
47+
build_bdist:
48+
name: Build BDist (${{matrix.os}})
49+
runs-on: ${{matrix.os}}
50+
defaults:
51+
run:
52+
working-directory: '${{github.workspace}}/lang/python'
53+
strategy:
54+
matrix:
55+
# Update upload_release when these are changed!!
56+
os: [ubuntu-22.04, windows-2022]
57+
steps:
58+
- name: Checkout Repository
59+
uses: actions/checkout@v4
60+
with:
61+
submodules: recursive
62+
63+
- name: Configure CMake
64+
working-directory: '${{github.workspace}}'
65+
run: cmake -G "Unix Makefiles" -B build -DCMAKE_BUILD_TYPE=Release -DSOURCEPP_BUILD_PYTHON_WRAPPERS=ON -DSOURCEPP_VERSION="${{inputs.version}}"
66+
67+
- name: Build BDist
68+
run: |
69+
python -m pip install cibuildwheel==3.1.1
70+
python -m cibuildwheel --output-dir dist
71+
72+
- name: Upload Artifact
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: dist-bdist-${{matrix.os}}
76+
path: '${{github.workspace}}/lang/python/dist/*.whl'
4677

4778
upload_release:
4879
name: Upload a Release
4980
if: inputs.release
50-
needs: [build_sdist]
81+
needs:
82+
- build_sdist
83+
- build_bdist
5184
runs-on: ubuntu-latest
5285
environment:
5386
name: pypi-release
5487
url: https://pypi.org/p/sourcepp
5588
permissions:
5689
id-token: write
5790
steps:
58-
- name: Download Artifacts
91+
- name: Download SDist
5992
uses: actions/download-artifact@v4
6093
with:
6194
name: dist-sdist
6295
path: dist
6396

97+
- name: Download BDist (ubuntu-22.04)
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: dist-bdist-ubuntu-22.04
101+
path: dist
102+
103+
- name: Download BDist (windows-2022)
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: dist-bdist-windows-2022
107+
path: dist
108+
64109
- name: Publish to PyPI
65110
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)