@@ -10,116 +10,111 @@ permissions:
1010 id-token : write # Required for trusted publishing to PyPI
1111
1212jobs :
13- # Build wheels for multiple platforms
14- build-wheels :
15- name : Build wheels (${{ matrix.target }})
16- runs-on : ${{ matrix.os }}
13+ # Build wheels for Linux
14+ linux :
15+ name : Build wheels (Linux ${{ matrix.target }})
16+ runs-on : ubuntu-latest
1717 timeout-minutes : 45
1818 strategy :
1919 fail-fast : false
2020 matrix :
21- include :
22- # Linux x86_64
23- - os : ubuntu-latest
24- target : x86_64-unknown-linux-gnu
25- manylinux : auto
26-
27- # Linux aarch64
28- - os : ubuntu-latest
29- target : aarch64-unknown-linux-gnu
30- manylinux : auto
21+ target : [x86_64, aarch64]
22+ steps :
23+ - uses : actions/checkout@v6
3124
32- # macOS x86_64
33- - os : macos-13
34- target : x86_64-apple-darwin
25+ - uses : actions/setup-python@v6
26+ with :
27+ python-version : ' 3.12 '
3528
36- # macOS ARM64
37- - os : macos-latest
38- target : aarch64-apple-darwin
29+ - name : Build wheels
30+ uses : PyO3/maturin-action@v1
31+ with :
32+ target : ${{ matrix.target }}
33+ args : --release --out dist
34+ manylinux : auto
35+ working-directory : crates/feedparser-rs-py
3936
40- # Windows x86_64
41- - os : windows-latest
42- target : x86_64-pc-windows-msvc
37+ - name : Upload wheels
38+ uses : actions/upload-artifact@v4
39+ with :
40+ name : wheels-linux-${{ matrix.target }}
41+ path : crates/feedparser-rs-py/dist/*.whl
42+ retention-days : 7
4343
44+ # Build wheels for macOS
45+ macos :
46+ name : Build wheels (macOS ${{ matrix.target }})
47+ runs-on : ${{ matrix.os }}
48+ timeout-minutes : 45
49+ strategy :
50+ fail-fast : false
51+ matrix :
52+ include :
53+ - os : macos-13
54+ target : x86_64
55+ - os : macos-latest
56+ target : aarch64
4457 steps :
4558 - uses : actions/checkout@v6
4659
47- - name : Install Rust
48- uses : dtolnay/rust-toolchain@stable
49- with :
50- targets : ${{ matrix.target }}
51-
52- - name : Setup Python
53- uses : actions/setup-python@v6
60+ - uses : actions/setup-python@v6
5461 with :
5562 python-version : ' 3.12'
5663
57- - name : Install maturin
58- run : pip install maturin
59-
60- - name : Cache Cargo
61- uses : Swatinem/rust-cache@v2
64+ - name : Build wheels
65+ uses : PyO3/maturin-action@v1
6266 with :
63- shared-key : " pypi-${{ matrix.target }}"
64- workspaces : crates/feedparser-rs-py
67+ target : ${{ matrix.target }}
68+ args : --release --out dist
69+ working-directory : crates/feedparser-rs-py
6570
66- - name : Build wheels (Linux)
67- if : matrix.os == 'ubuntu-latest'
68- working-directory : crates/feedparser-rs-py
69- run : |
70- maturin build --release --target ${{ matrix.target }} \
71- --manylinux ${{ matrix.manylinux }} --out dist
71+ - name : Upload wheels
72+ uses : actions/upload-artifact@v4
73+ with :
74+ name : wheels-macos-${{ matrix.target }}
75+ path : crates/feedparser-rs-py/dist/*.whl
76+ retention-days : 7
7277
73- - name : Build wheels (macOS/Windows)
74- if : matrix.os != 'ubuntu-latest'
75- working-directory : crates/feedparser-rs-py
76- run : |
77- maturin build --release --target ${{ matrix.target }} --out dist
78+ # Build wheels for Windows
79+ windows :
80+ name : Build wheels (Windows)
81+ runs-on : windows-latest
82+ timeout-minutes : 45
83+ steps :
84+ - uses : actions/checkout@v6
7885
79- - name : List built wheels
80- working-directory : crates/feedparser-rs-py
81- run : ls -lh dist/
86+ - uses : actions/setup-python@v6
87+ with :
88+ python-version : ' 3.12 '
8289
83- - name : Test wheel installation
84- if : matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'x86_64-pc-windows-msvc' || matrix.target == 'x86_64-apple-darwin'
85- working-directory : crates/feedparser-rs-py
86- run : |
87- pip install dist/*.whl
88- python -c "import feedparser_rs; print('Successfully imported feedparser_rs')"
90+ - name : Build wheels
91+ uses : PyO3/maturin-action@v1
92+ with :
93+ target : x64
94+ args : --release --out dist
95+ working-directory : crates/feedparser-rs-py
8996
9097 - name : Upload wheels
9198 uses : actions/upload-artifact@v4
9299 with :
93- name : wheels-${{ matrix.target }}
100+ name : wheels-windows-x64
94101 path : crates/feedparser-rs-py/dist/*.whl
95102 retention-days : 7
96103
97104 # Build source distribution
98- build- sdist :
105+ sdist :
99106 name : Build source distribution
100107 runs-on : ubuntu-latest
101108 timeout-minutes : 15
102109 steps :
103110 - uses : actions/checkout@v6
104111
105- - name : Install Rust
106- uses : dtolnay/rust-toolchain@stable
107-
108- - name : Setup Python
109- uses : actions/setup-python@v6
112+ - name : Build sdist
113+ uses : PyO3/maturin-action@v1
110114 with :
111- python-version : ' 3.12'
112-
113- - name : Install maturin
114- run : pip install maturin
115-
116- - name : Build source distribution
117- working-directory : crates/feedparser-rs-py
118- run : maturin sdist --out dist
119-
120- - name : List sdist
121- working-directory : crates/feedparser-rs-py
122- run : ls -lh dist/
115+ command : sdist
116+ args : --out dist
117+ working-directory : crates/feedparser-rs-py
123118
124119 - name : Upload sdist
125120 uses : actions/upload-artifact@v4
@@ -129,17 +124,17 @@ jobs:
129124 retention-days : 7
130125
131126 # Publish to PyPI
132- publish-pypi :
127+ publish :
133128 name : Publish to PyPI
134129 runs-on : ubuntu-latest
135- needs : [build-wheels, build- sdist]
130+ needs : [linux, macos, windows, sdist]
136131 timeout-minutes : 10
137132 environment :
138133 name : pypi
139134 url : https://pypi.org/p/feedparser-rs
140135
141136 steps :
142- - name : Download all artifacts
137+ - name : Download all wheels
143138 uses : actions/download-artifact@v4
144139 with :
145140 path : dist
@@ -166,7 +161,7 @@ jobs:
166161 github-release :
167162 name : Create GitHub Release
168163 runs-on : ubuntu-latest
169- needs : [publish-pypi ]
164+ needs : [publish]
170165 timeout-minutes : 10
171166 permissions :
172167 contents : write
0 commit comments