Skip to content

Commit 082ba89

Browse files
Add GitHub Actions workflow for building Python wheels across multiple platforms
1 parent 3bc81f8 commit 082ba89

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/build-wheels.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Publish Python Wheels
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-wheels:
10+
name: Build wheels on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install setuptools wheel build
29+
30+
- name: Build wheels
31+
run: |
32+
cd python
33+
python -m build --wheel
34+
35+
- name: Upload wheels
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: python-wheels
39+
path: python/dist/*.whl
40+
41+
publish-release:
42+
needs: build-wheels
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Download wheels
48+
uses: actions/download-artifact@v3
49+
with:
50+
name: python-wheels
51+
path: dist
52+
53+
- name: Create Release
54+
uses: softprops/action-gh-release@v1
55+
if: startsWith(github.ref, 'refs/tags/')
56+
with:
57+
files: dist/*.whl
58+
draft: false
59+
prerelease: false

0 commit comments

Comments
 (0)