Skip to content

Commit f662ca7

Browse files
author
amiya
committed
github actions updated
1 parent 0aa36ea commit f662ca7

2 files changed

Lines changed: 65 additions & 21 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
run: maturin build --release --out dist
3333

3434
- name: Install package
35+
shell: bash
3536
run: pip install --force-reinstall dist/*.whl
3637

3738
- name: Run tests

.github/workflows/release.yml

Lines changed: 64 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,86 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
release:
10-
name: Build and Release
9+
linux:
1110
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
target: [x86_64, aarch64]
1214
steps:
1315
- uses: actions/checkout@v4
1416
- name: Build wheels
1517
uses: PyO3/maturin-action@v1
1618
with:
17-
command: build
19+
target: ${{ matrix.target }}
1820
args: --release --out dist --find-interpreter
1921
manylinux: auto
20-
targets: |
21-
# Build wheels for linux
22-
x86_64-unknown-linux-gnu
23-
aarch64-unknown-linux-gnu
24-
# Build wheels for windows
25-
x86_64-pc-windows-msvc
26-
# Build wheels for macos
27-
x86_64-apple-darwin
28-
aarch64-apple-darwin
22+
- name: Upload wheels
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: wheels-linux-${{ matrix.target }}
26+
path: dist
27+
28+
windows:
29+
runs-on: windows-latest
30+
strategy:
31+
matrix:
32+
target: [x64]
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Build wheels
36+
uses: PyO3/maturin-action@v1
37+
with:
38+
target: ${{ matrix.target }}
39+
args: --release --out dist --find-interpreter
40+
- name: Upload wheels
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: wheels-windows-${{ matrix.target }}
44+
path: dist
2945

46+
macos:
47+
runs-on: macos-latest
48+
strategy:
49+
matrix:
50+
target: [x86_64, aarch64]
51+
steps:
52+
- uses: actions/checkout@v4
53+
- name: Build wheels
54+
uses: PyO3/maturin-action@v1
55+
with:
56+
target: ${{ matrix.target }}
57+
args: --release --out dist --find-interpreter
58+
- name: Upload wheels
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: wheels-macos-${{ matrix.target }}
62+
path: dist
63+
64+
sdist:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
3068
- name: Build sdist
3169
uses: PyO3/maturin-action@v1
3270
with:
3371
command: sdist
3472
args: --out dist
35-
36-
- name: Install Python and maturin
37-
uses: actions/setup-python@v5
73+
- name: Upload sdist
74+
uses: actions/upload-artifact@v4
3875
with:
39-
python-version: '3.x'
40-
- name: Install built package
41-
run: pip install --force-reinstall dist/*.whl
42-
43-
- name: Run tests
44-
run: python tests/test_all.py
76+
name: wheels-sdist
77+
path: dist
4578

79+
release:
80+
name: Release
81+
runs-on: ubuntu-latest
82+
needs: [linux, windows, macos, sdist]
83+
steps:
84+
- uses: actions/download-artifact@v4
85+
with:
86+
pattern: wheels-*
87+
merge-multiple: true
88+
path: dist
4689
- name: Publish to PyPI
4790
uses: PyO3/maturin-action@v1
4891
env:

0 commit comments

Comments
 (0)