Skip to content

Commit 4e1bd59

Browse files
committed
modify CI
1 parent 36cc4d1 commit 4e1bd59

File tree

1 file changed

+84
-7
lines changed

1 file changed

+84
-7
lines changed

.github/workflows/CI.yml

+84-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This file is autogenerated by maturin v1.5.1
1+
# This file is autogenerated by maturin v1.7.0
22
# To update, run
33
#
4-
# maturin generate-ci -o .github/workflows/CI.yml github
4+
# maturin generate-ci github -m Cargo.toml --platform all -o .github/workflows/CI.yml
55
#
66
name: CI
77

@@ -40,7 +40,7 @@ jobs:
4040
- uses: actions/checkout@v4
4141
- uses: actions/setup-python@v5
4242
with:
43-
python-version: '3.10'
43+
python-version: 3.x
4444
- name: Build wheels
4545
uses: PyO3/maturin-action@v1
4646
with:
@@ -54,6 +54,37 @@ jobs:
5454
name: wheels-linux-${{ matrix.platform.target }}
5555
path: dist
5656

57+
musllinux:
58+
runs-on: ${{ matrix.platform.runner }}
59+
strategy:
60+
matrix:
61+
platform:
62+
- runner: ubuntu-latest
63+
target: x86_64
64+
- runner: ubuntu-latest
65+
target: x86
66+
- runner: ubuntu-latest
67+
target: aarch64
68+
- runner: ubuntu-latest
69+
target: armv7
70+
steps:
71+
- uses: actions/checkout@v4
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: 3.x
75+
- name: Build wheels
76+
uses: PyO3/maturin-action@v1
77+
with:
78+
target: ${{ matrix.platform.target }}
79+
args: --release --out dist --find-interpreter
80+
sccache: 'true'
81+
manylinux: musllinux_1_2
82+
- name: Upload wheels
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: wheels-musllinux-${{ matrix.platform.target }}
86+
path: dist
87+
5788
windows:
5889
runs-on: ${{ matrix.platform.runner }}
5990
strategy:
@@ -67,7 +98,7 @@ jobs:
6798
- uses: actions/checkout@v4
6899
- uses: actions/setup-python@v5
69100
with:
70-
python-version: '3.10'
101+
python-version: 3.x
71102
architecture: ${{ matrix.platform.target }}
72103
- name: Build wheels
73104
uses: PyO3/maturin-action@v1
@@ -86,15 +117,15 @@ jobs:
86117
strategy:
87118
matrix:
88119
platform:
89-
- runner: macos-latest
120+
- runner: macos-12
90121
target: x86_64
91122
- runner: macos-14
92123
target: aarch64
93124
steps:
94125
- uses: actions/checkout@v4
95126
- uses: actions/setup-python@v5
96127
with:
97-
python-version: '3.10'
128+
python-version: 3.x
98129
- name: Build wheels
99130
uses: PyO3/maturin-action@v1
100131
with:
@@ -107,6 +138,43 @@ jobs:
107138
name: wheels-macos-${{ matrix.platform.target }}
108139
path: dist
109140

141+
emscripten:
142+
runs-on: ${{ matrix.platform.runner }}
143+
strategy:
144+
matrix:
145+
platform:
146+
- runner: ubuntu-latest
147+
target: wasm32-unknown-emscripten
148+
steps:
149+
- uses: actions/checkout@v4
150+
- run: pip install pyodide-build
151+
- name: Get Emscripten and Python version info
152+
shell: bash
153+
run: |
154+
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
155+
echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
156+
pip uninstall -y pyodide-build
157+
- uses: mymindstorm/setup-emsdk@v12
158+
with:
159+
version: ${{ env.EMSCRIPTEN_VERSION }}
160+
actions-cache-folder: emsdk-cache
161+
- uses: actions/setup-python@v5
162+
with:
163+
python-version: ${{ env.PYTHON_VERSION }}
164+
- run: pip install pyodide-build
165+
- name: Build wheels
166+
uses: PyO3/maturin-action@v1
167+
with:
168+
target: ${{ matrix.platform.target }}
169+
args: --release --out dist -i ${{ env.PYTHON_VERSION }}
170+
sccache: 'true'
171+
rust-toolchain: nightly
172+
- name: Upload wheels
173+
uses: actions/upload-artifact@v4
174+
with:
175+
name: wasm-wheels
176+
path: dist
177+
110178
sdist:
111179
runs-on: ubuntu-latest
112180
steps:
@@ -126,7 +194,10 @@ jobs:
126194
name: Release
127195
runs-on: ubuntu-latest
128196
if: "startsWith(github.ref, 'refs/tags/')"
129-
needs: [linux, windows, macos, sdist]
197+
needs: [linux, musllinux, windows, macos, emscripten, sdist]
198+
permissions:
199+
# Used to upload release artifacts
200+
contents: write
130201
steps:
131202
- uses: actions/download-artifact@v4
132203
- name: Publish to PyPI
@@ -136,3 +207,9 @@ jobs:
136207
with:
137208
command: upload
138209
args: --non-interactive --skip-existing wheels-*/*
210+
- name: Upload to GitHub Release
211+
uses: softprops/action-gh-release@v1
212+
with:
213+
files: |
214+
wasm-wheels/*.whl
215+
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}

0 commit comments

Comments
 (0)