5353 pip install abi3audit
5454 abi3audit --strict -v --report ./wheelhouse/*.whl
5555 if : ${{ contains(fromJSON('["cp312", "cp313"]'), matrix.python) }}
56- - uses : actions/upload-artifact@v5
56+ - uses : actions/upload-artifact@v6
5757 with :
58- name : artifact -${{ matrix.os }}-${{ matrix.python }}
58+ name : wheels -${{ matrix.os }}-${{ matrix.python }}
5959 path : ./wheelhouse/*.whl
6060
6161 build_sdist :
@@ -78,28 +78,68 @@ jobs:
7878
7979 - uses : actions/upload-artifact@v6
8080 with :
81+ name : sdist
8182 path : dist/*.tar.gz
8283
84+ collect_dist :
85+ name : Collect distributions
86+ runs-on : ubuntu-latest
87+ needs : [build_wheels, build_sdist]
88+
89+ steps :
90+ - name : Download wheels
91+ uses : actions/download-artifact@v7
92+ with :
93+ pattern : wheels-*
94+ path : dist
95+ merge-multiple : true
96+
97+ - name : Download sdist
98+ uses : actions/download-artifact@v7
99+ with :
100+ name : sdist
101+ path : dist
102+
103+ - name : Verify distributions
104+ run : |
105+ echo "Wheels:"
106+ ls -lh dist/*.whl
107+ echo
108+ echo "Source distributions:"
109+ ls -lh dist/*.tar.gz
110+
111+ - name : Twine check
112+ run : |
113+ pip install -U twine packaging
114+ twine check dist/*
115+
116+ - name : Upload merged dist
117+ uses : actions/upload-artifact@v6
118+ with :
119+ name : dist
120+ path : dist/*
121+
83122 release :
84123 name : Release
85- environment :
86- name : release
87- url : https://pypi.org/p/onnxoptimizer
88124 runs-on : ubuntu-latest
125+ needs : collect_dist
126+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
127+
89128 permissions :
90129 id-token : write
91-
92- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
93- needs : [build_wheels, build_sdist]
130+
131+ environment :
132+ name : release
133+ url : https://pypi.org/p/onnxoptimizer
134+
94135 steps :
95- - uses : actions/download-artifact@v7
136+ - name : Download distributions
137+ uses : actions/download-artifact@v7
96138 with :
97- name : artifact
139+ name : dist
98140 path : dist
99-
100- - name : Publish distribution 📦 to PyPI
101- if : startsWith(github.ref, 'refs/tags/v')
141+
142+ - name : Publish to PyPI
102143 uses : pypa/gh-action-pypi-publish@release/v1
103144 with :
104- repository-url : https://upload.pypi.org/legacy/
105145 attestations : true
0 commit comments