@@ -42,15 +42,20 @@ jobs:
4242 platform :
4343 - runner : ubuntu-latest
4444 target : x86_64-unknown-linux-gnu
45- - runner : macOS-latest
46- target : x86_64-apple-darwin
47- - runner : macOS -latest
45+ - runner : ubuntu-24.04-arm
46+ target : aarch64-unknown-linux-gnu
47+ - runner : macos -latest
4848 target : aarch64-apple-darwin
49+ - runner : macos-15-intel
50+ target : x86_64-apple-darwin
4951 - runner : windows-latest
5052 target : x86_64-pc-windows-msvc
53+ - runner : windows-latest
54+ target : aarch64-pc-windows-msvc
55+ skip_test_run : true
5156 toolchain : [stable]
5257 features :
53- - value : " embedded -ipadic"
58+ - value : " embed -ipadic"
5459 package_name : " lindera-python-ipadic"
5560 package_description : " Python binding for Lindera with IPADIC dictionary"
5661
@@ -67,97 +72,43 @@ jobs:
6772 components : rustfmt, clippy
6873
6974 - name : Run test
70- run : cargo test --target "${{ matrix.platform.target }}" --features="${{ matrix.features.value }}"
75+ shell : bash
76+ run : |
77+ if [ "${{ matrix.platform.skip_test_run }}" == "true" ]; then
78+ export PYO3_CROSS_PYTHON_VERSION=3.10
79+ cargo check --target "${{ matrix.platform.target }}" --all-features
80+ else
81+ cargo test --target "${{ matrix.platform.target }}" --all-features
82+ fi
7183
7284 linux :
7385 name : Linux
7486 needs : [test]
7587 strategy :
76- max-parallel : 1
7788 matrix :
7889 platform :
7990 - runner : ubuntu-latest
80- target : x86_64
81- toolchain : [stable]
82- features :
83- - value : " default"
84- package_name : " lindera-python"
85- package_description : " Python binding for Lindera (no embedded dictionaries)"
86- - value : " embedded-cjk"
87- package_name : " lindera-python-cjk"
88- package_description : " Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
89- - value : " embedded-ipadic"
90- package_name : " lindera-python-ipadic"
91- package_description : " Python binding for Lindera with IPADIC dictionary"
92- - value : " embedded-unidic"
93- package_name : " lindera-python-unidic"
94- package_description : " Python binding for Lindera with UniDic dictionary"
95- - value : " embedded-ko-dic"
96- package_name : " lindera-python-ko-dic"
97- package_description : " Python binding for Lindera with ko-dic Korean dictionary"
98- - value : " embedded-cc-cedict"
99- package_name : " lindera-python-cc-cedict"
100- package_description : " Python binding for Lindera with CC-CEDICT Chinese dictionary"
101- runs-on : ${{ matrix.platform.runner }}
102- steps :
103- - name : Run checkout
104- uses : actions/checkout@v6
105-
106- - name : Setup Python
107- uses : actions/setup-python@v6
108- with :
109- python-version : 3.x
110-
111- - name : Create package-specific pyproject.toml
112- run : |
113- # Modify pyproject.toml in place
114- sed -i "s/^name = \"lindera-python\"/name = \"${{ matrix.features.package_name }}\"/" pyproject.toml
115- sed -i "s/^description = \".*\"/description = \"${{ matrix.features.package_description }}\"/" pyproject.toml
116-
117- - name : Build wheels
118- uses : PyO3/maturin-action@v1
119- env :
120- NODE_OPTIONS : " --max-old-space-size=8192"
121- with :
122- target : ${{ matrix.platform.target }}
123- args : --release --out dist --find-interpreter --features=${{ matrix.features.value }}
124- sccache : " true"
125- manylinux : auto
126- before-script-linux : " yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y"
127-
128- - name : Upload wheels
129- uses : actions/upload-artifact@v6
130- with :
131- name : wheels-${{ matrix.features.package_name }}-linux-${{ matrix.platform.target }}-${{ github.ref_name }}
132- path : dist
133-
134- linux2 :
135- name : Linux2
136- needs : [test]
137- strategy :
138- max-parallel : 1
139- matrix :
140- platform :
141- - runner : ubuntu-latest
142- target : aarch64
91+ target : x86_64-unknown-linux-gnu
92+ - runner : ubuntu-24.04-arm
93+ target : aarch64-unknown-linux-gnu
14394 toolchain : [stable]
14495 features :
14596 - value : " default"
14697 package_name : " lindera-python"
14798 package_description : " Python binding for Lindera (no embedded dictionaries)"
148- - value : " embedded -cjk"
99+ - value : " embed -cjk"
149100 package_name : " lindera-python-cjk"
150101 package_description : " Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
151- - value : " embedded -ipadic"
102+ - value : " embed -ipadic"
152103 package_name : " lindera-python-ipadic"
153104 package_description : " Python binding for Lindera with IPADIC dictionary"
154- - value : " embedded -unidic"
105+ - value : " embed -unidic"
155106 package_name : " lindera-python-unidic"
156107 package_description : " Python binding for Lindera with UniDic dictionary"
157- - value : " embedded -ko-dic"
108+ - value : " embed -ko-dic"
158109 package_name : " lindera-python-ko-dic"
159110 package_description : " Python binding for Lindera with ko-dic Korean dictionary"
160- - value : " embedded -cc-cedict"
111+ - value : " embed -cc-cedict"
161112 package_name : " lindera-python-cc-cedict"
162113 package_description : " Python binding for Lindera with CC-CEDICT Chinese dictionary"
163114 runs-on : ${{ matrix.platform.runner }}
@@ -185,7 +136,12 @@ jobs:
185136 args : --release --out dist --find-interpreter --features=${{ matrix.features.value }}
186137 sccache : " true"
187138 manylinux : auto
188- before-script-linux : " apt-get update && apt-get install libssl-dev pkg-config -y"
139+ before-script-linux : |
140+ if command -v yum >/dev/null 2>&1; then
141+ yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y
142+ elif command -v apt-get >/dev/null 2>&1; then
143+ apt-get update && apt-get install libssl-dev pkg-config -y
144+ fi
189145
190146 - name : Upload wheels
191147 uses : actions/upload-artifact@v6
@@ -201,25 +157,27 @@ jobs:
201157 matrix :
202158 platform :
203159 - runner : windows-latest
204- target : x64
160+ target : x86_64-pc-windows-msvc
161+ - runner : windows-latest
162+ target : aarch64-pc-windows-msvc
205163 toolchain : [stable]
206164 features :
207165 - value : " default"
208166 package_name : " lindera-python"
209167 package_description : " Python binding for Lindera (no embedded dictionaries)"
210- - value : " embedded -cjk"
168+ - value : " embed -cjk"
211169 package_name : " lindera-python-cjk"
212170 package_description : " Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
213- - value : " embedded -ipadic"
171+ - value : " embed -ipadic"
214172 package_name : " lindera-python-ipadic"
215173 package_description : " Python binding for Lindera with IPADIC dictionary"
216- - value : " embedded -unidic"
174+ - value : " embed -unidic"
217175 package_name : " lindera-python-unidic"
218176 package_description : " Python binding for Lindera with UniDic dictionary"
219- - value : " embedded -ko-dic"
177+ - value : " embed -ko-dic"
220178 package_name : " lindera-python-ko-dic"
221179 package_description : " Python binding for Lindera with ko-dic Korean dictionary"
222- - value : " embedded -cc-cedict"
180+ - value : " embed -cc-cedict"
223181 package_name : " lindera-python-cc-cedict"
224182 package_description : " Python binding for Lindera with CC-CEDICT Chinese dictionary"
225183 runs-on : ${{ matrix.platform.runner }}
@@ -231,7 +189,7 @@ jobs:
231189 uses : actions/setup-python@v6
232190 with :
233191 python-version : 3.x
234- architecture : ${{ matrix.platform.target }}
192+ architecture : ${{ contains( matrix.platform.target, 'aarch64') && 'arm64' || 'x64' }}
235193
236194 - name : Create package-specific pyproject.toml
237195 shell : pwsh
@@ -258,34 +216,34 @@ jobs:
258216 path : dist
259217
260218 macos :
261- name : MacOS
219+ name : macOS
262220 needs : [test]
263221 strategy :
264222 max-parallel : 1
265223 matrix :
266224 platform :
267225 - runner : macos-latest
268- target : x86_64
269- - runner : macos-latest
270- target : aarch64
226+ target : aarch64-apple-darwin
227+ - runner : macos-15-intel
228+ target : x86_64-apple-darwin
271229 toolchain : [stable]
272230 features :
273231 - value : " default"
274232 package_name : " lindera-python"
275233 package_description : " Python binding for Lindera (no embedded dictionaries)"
276- - value : " embedded -cjk"
234+ - value : " embed -cjk"
277235 package_name : " lindera-python-cjk"
278236 package_description : " Python binding for Lindera with CJK dictionaries (IPADIC, ko-dic, CC-CEDICT)"
279- - value : " embedded -ipadic"
237+ - value : " embed -ipadic"
280238 package_name : " lindera-python-ipadic"
281239 package_description : " Python binding for Lindera with IPADIC dictionary"
282- - value : " embedded -unidic"
240+ - value : " embed -unidic"
283241 package_name : " lindera-python-unidic"
284242 package_description : " Python binding for Lindera with UniDic dictionary"
285- - value : " embedded -ko-dic"
243+ - value : " embed -ko-dic"
286244 package_name : " lindera-python-ko-dic"
287245 package_description : " Python binding for Lindera with ko-dic Korean dictionary"
288- - value : " embedded -cc-cedict"
246+ - value : " embed -cc-cedict"
289247 package_name : " lindera-python-cc-cedict"
290248 package_description : " Python binding for Lindera with CC-CEDICT Chinese dictionary"
291249 runs-on : ${{ matrix.platform.runner }}
@@ -339,8 +297,7 @@ jobs:
339297
340298 release :
341299 name : GitHub Release
342- # needs: [linux, linux2, musllinux, windows, macos, sdist]
343- needs : [linux, linux2, windows, macos, sdist]
300+ needs : [linux, windows, macos, sdist]
344301 runs-on : ubuntu-latest
345302 if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
346303 permissions :
@@ -374,7 +331,7 @@ jobs:
374331
375332 publish-pypi :
376333 name : Publish to PyPI
377- needs : [linux, linux2, windows, macos, sdist]
334+ needs : [linux, windows, macos, sdist]
378335 runs-on : ubuntu-latest
379336 if : ${{ startsWith(github.ref, 'refs/tags/') }}
380337 permissions :
@@ -413,10 +370,10 @@ jobs:
413370
414371 - name : Publish lindera-python
415372 run : |
416- LINDERA_PY_VERSION =$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="lindera-python") | .version')
417- LINDERA_PY_VERSIONS =$(curl -s -XGET https://crates.io/api/v1/crates/lindera-python | jq -r 'select(.versions != null) | .versions[].num')
418- if echo ${LINDERA_PY_VERSIONS } | grep ${LINDERA_PY_VERSION } >/dev/null; then
419- echo "lindera-python ${LINDERA_PY_VERSION } has already published"
373+ LINDERA_PYTHON_VERSION =$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="lindera-python") | .version')
374+ LINDERA_PYTHON_VERSIONS =$(curl -s -XGET https://crates.io/api/v1/crates/lindera-python | jq -r 'select(.versions != null) | .versions[].num')
375+ if echo ${LINDERA_PYTHON_VERSIONS } | grep ${LINDERA_PYTHON_VERSION } >/dev/null; then
376+ echo "lindera-python ${LINDERA_PYTHON_VERSION } has already published"
420377 else
421378 cargo publish
422379 fi
0 commit comments