Skip to content

Commit

Permalink
Fixed if condition for release job (#478)
Browse files Browse the repository at this point in the history
* Fixed if condition for release job

* Added the test release job, changed if condition

* Merged all upload steps into one for pre-release
  • Loading branch information
asenyaev authored May 6, 2021
1 parent aa26990 commit 88c1735
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,27 @@ jobs:
name: wheels
path: dist/opencv*.tar.gz

test_release_opencv_python:
if: github.event_name == 'release' && github.event.release.prerelease
needs: [build, build-windows-x86_64, build_sdist]
runs-on: ubuntu-latest
environment: test-opencv-python-release
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: wheelhouse/

- name: Upload all wheels
run: |
python -m pip install twine
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
release_opencv_python:
if: startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'release' && !github.event.release.prerelease
needs: [build, build-windows-x86_64, build_sdist]
runs-on: ubuntu-latest
environment: opencv-python-release
Expand All @@ -257,6 +276,7 @@ jobs:
with:
name: wheels
path: wheelhouse/

- name: Upload wheels for opencv_python
run: |
python -m pip install twine
Expand All @@ -273,7 +293,6 @@ jobs:
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
- name: Upload wheels for opencv_contrib_python_headless

run: |
python -m pip install twine
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 comments on commit 88c1735

Please sign in to comment.