@@ -153,6 +153,9 @@ jobs:
153153 needs : [Build, Test]
154154 runs-on : ubuntu-22.04
155155 environment : opencv-python-rolling-release
156+ permissions :
157+ contents : read
158+ id-token : write
156159 defaults :
157160 run :
158161 shell : bash
@@ -161,28 +164,46 @@ jobs:
161164 with :
162165 name : wheels
163166 path : wheelhouse/
164- - name : Upload wheels for opencv_python_rolling
167+ - name : Select only OpenCV wheels
165168 run : |
166- python -m pip install twine
167- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-*
169+ mkdir dist dist-contrib dist-headless dist-contrib-headless
170+ cp wheelhouse/opencv_python_rolling-* dist/
171+ cp wheelhouse/opencv_contrib_python_rolling-* dist-contrib/
172+ cp wheelhouse/opencv_python_headless_rolling-* dist-headless/
173+ cp wheelhouse/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
174+ - name : Upload wheels for opencv_python_rolling
175+ uses : pypa/gh-action-pypi-publish@release/v1
176+ with :
177+ packages-dir : dist/
178+ print-hash : true
179+ skip-existing : true
168180 - name : Upload wheels for opencv_contrib_python_rolling
169- run : |
170- python -m pip install twine
171- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-*
181+ uses : pypa/gh-action-pypi-publish@release/v1
182+ with :
183+ packages-dir : dist-contrib/
184+ print-hash : true
185+ skip-existing : true
172186 - name : Upload wheels for opencv_python_headless_rolling
173- run : |
174- python -m pip install twine
175- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-*
187+ uses : pypa/gh-action-pypi-publish@release/v1
188+ with :
189+ packages-dir : dist-headless/
190+ print-hash : true
191+ skip-existing : true
176192 - name : Upload wheels for opencv_contrib_python_headless_rolling
177- run : |
178- python -m pip install twine
179- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-*
193+ uses : pypa/gh-action-pypi-publish@release/v1
194+ with :
195+ packages-dir : dist-contrib-headless/
196+ print-hash : true
197+ skip-existing : true
180198
181199 Pre-release :
182200 if : github.event_name == 'release' && github.event.release.prerelease
183201 needs : [Build, Test]
184202 runs-on : ubuntu-22.04
185203 environment : test-opencv-python-release
204+ permissions :
205+ contents : read
206+ id-token : write
186207 defaults :
187208 run :
188209 shell : bash
@@ -191,16 +212,27 @@ jobs:
191212 with :
192213 name : wheels
193214 path : wheelhouse/
194- - name : Upload all wheels
215+ - name : Select only OpenCV wheels
195216 run : |
196- python -m pip install twine
197- python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
217+ mkdir dist
218+ cp wheelhouse/opencv_* dist/
219+ - name : Upload all wheels
220+ uses : pypa/gh-action-pypi-publish@release/v1
221+ with :
222+ packages-dir : dist/
223+ print-hash : true
224+ repository-url : https://test.pypi.org/legacy/
225+ skip-existing : true
226+ verbose : true
198227
199228 Release :
200229 if : github.event_name == 'release' && !github.event.release.prerelease
201230 needs : [Build, Test]
202231 runs-on : ubuntu-22.04
203232 environment : opencv-python-release
233+ permissions :
234+ contents : read
235+ id-token : write
204236 defaults :
205237 run :
206238 shell : bash
@@ -209,19 +241,34 @@ jobs:
209241 with :
210242 name : wheels
211243 path : wheelhouse/
212- - name : Upload wheels for opencv_python
244+ - name : Select only OpenCV wheels
213245 run : |
214- python -m pip install twine
215- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
246+ mkdir dist dist-contrib dist-headless dist-contrib-headless
247+ cp wheelhouse/opencv_python-* dist/
248+ cp wheelhouse/opencv_contrib_python-* dist-contrib/
249+ cp wheelhouse/opencv_python_headless-* dist-headless/
250+ cp wheelhouse/opencv_contrib_python_headless-* dist-contrib-headless/
251+ - name : Upload wheels for opencv_python
252+ uses : pypa/gh-action-pypi-publish@release/v1
253+ with :
254+ packages-dir : dist/
255+ print-hash : true
256+ skip-existing : true
216257 - name : Upload wheels for opencv_contrib_python
217- run : |
218- python -m pip install twine
219- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
258+ uses : pypa/gh-action-pypi-publish@release/v1
259+ with :
260+ packages-dir : dist-contrib/
261+ print-hash : true
262+ skip-existing : true
220263 - name : Upload wheels for opencv_python_headless
221- run : |
222- python -m pip install twine
223- python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
264+ uses : pypa/gh-action-pypi-publish@release/v1
265+ with :
266+ packages-dir : dist-headless/
267+ print-hash : true
268+ skip-existing : true
224269 - name : Upload wheels for opencv_contrib_python_headless
225- run : |
226- python -m pip install twine
227- python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
270+ uses : pypa/gh-action-pypi-publish@release/v1
271+ with :
272+ packages-dir : dist-contrib-headless/
273+ print-hash : true
274+ skip-existing : true
0 commit comments