Skip to content

Commit 88c1735

Browse files
authored
Fixed if condition for release job (#478)
* Fixed if condition for release job * Added the test release job, changed if condition * Merged all upload steps into one for pre-release
1 parent aa26990 commit 88c1735

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/build_wheels.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,27 @@ jobs:
244244
name: wheels
245245
path: dist/opencv*.tar.gz
246246

247+
test_release_opencv_python:
248+
if: github.event_name == 'release' && github.event.release.prerelease
249+
needs: [build, build-windows-x86_64, build_sdist]
250+
runs-on: ubuntu-latest
251+
environment: test-opencv-python-release
252+
defaults:
253+
run:
254+
shell: bash
255+
steps:
256+
- uses: actions/download-artifact@v2
257+
with:
258+
name: wheels
259+
path: wheelhouse/
260+
261+
- name: Upload all wheels
262+
run: |
263+
python -m pip install twine
264+
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
265+
247266
release_opencv_python:
248-
if: startsWith(github.ref, 'refs/tags/v')
267+
if: github.event_name == 'release' && !github.event.release.prerelease
249268
needs: [build, build-windows-x86_64, build_sdist]
250269
runs-on: ubuntu-latest
251270
environment: opencv-python-release
@@ -257,6 +276,7 @@ jobs:
257276
with:
258277
name: wheels
259278
path: wheelhouse/
279+
260280
- name: Upload wheels for opencv_python
261281
run: |
262282
python -m pip install twine
@@ -273,7 +293,6 @@ jobs:
273293
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
274294
275295
- name: Upload wheels for opencv_contrib_python_headless
276-
277296
run: |
278297
python -m pip install twine
279298
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-*

0 commit comments

Comments
 (0)