|
1 | 1 | name: Build PYPI wheels for opencv-python
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - pull_request: |
5 |
| - branches: |
6 |
| - - master |
| 4 | + push: |
7 | 5 | release:
|
8 | 6 | types: [published, edited]
|
9 | 7 |
|
10 | 8 |
|
11 | 9 | jobs:
|
12 |
| - build-windows-x86_64: |
13 |
| - runs-on: ${{ matrix.os }} |
14 |
| - defaults: |
15 |
| - run: |
16 |
| - shell: powershell |
17 |
| - |
18 |
| - strategy: |
19 |
| - fail-fast: false |
20 |
| - matrix: |
21 |
| - os: [windows-latest] |
22 |
| - python-version: [3.6, 3.7, 3.8, 3.9] |
23 |
| - platform: [x86, x64] |
24 |
| - with_contrib: [0, 1] |
25 |
| - without_gui: [0, 1] |
26 |
| - build_sdist: [0] |
27 |
| - |
28 |
| - env: |
29 |
| - ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
30 |
| - SDIST: ${{ matrix.build_sdist || 0}} |
31 |
| - ENABLE_HEADLESS: ${{ matrix.without_gui }} |
32 |
| - ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
33 |
| - |
34 |
| - steps: |
35 |
| - - name: Checkout |
36 |
| - uses: actions/checkout@v2 |
37 |
| - with: |
38 |
| - submodules: true |
39 |
| - fetch-depth: 0 |
40 |
| - |
41 |
| - - name: Update submodules |
42 |
| - run: | |
43 |
| - git submodule update --remote |
44 |
| -
|
45 |
| - - name: Set up Python ${{ matrix.python-version }} |
46 |
| - uses: actions/setup-python@v2 |
47 |
| - with: |
48 |
| - python-version: ${{ matrix.python-version }} |
49 |
| - architecture: ${{ matrix.platform }} |
50 |
| - |
51 |
| - - name: Setup MSBuild.exe |
52 |
| - uses: warrenbuckley/Setup-MSBuild@v1 |
53 |
| - |
54 |
| - - name: build script |
55 |
| - run: | |
56 |
| - python --version |
57 |
| - python -m pip install --upgrade pip |
58 |
| - python -m pip install --upgrade setuptools |
59 |
| - set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose |
60 |
| - shell: cmd |
61 |
| - |
62 |
| - - name: before test |
63 |
| - run: | |
64 |
| - cd ${{ github.workspace }}/tests |
65 |
| - &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") |
66 |
| - if ($LastExitCode -ne 0) {throw $LastExitCode} |
67 |
| - shell: powershell |
68 |
| - |
69 |
| - - name: run test |
70 |
| - run: | |
71 |
| - cd ${{ github.workspace }}/tests |
72 |
| - python -m unittest test |
73 |
| - shell: cmd |
74 |
| - |
75 |
| - - name: saving artifacts |
76 |
| - uses: actions/upload-artifact@v2 |
77 |
| - with: |
78 |
| - name: wheels |
79 |
| - path: wheelhouse/opencv*.whl |
80 |
| - |
81 |
| - build: |
82 |
| - runs-on: ${{ matrix.os }} |
83 |
| - defaults: |
84 |
| - run: |
85 |
| - shell: bash |
86 |
| - |
87 |
| - strategy: |
88 |
| - fail-fast: false |
89 |
| - matrix: |
90 |
| - os: [ubuntu-latest, macos-latest] |
91 |
| - python-version: [3.6, 3.7, 3.8, 3.9] |
92 |
| - platform: [x64] |
93 |
| - with_contrib: [0, 1] |
94 |
| - without_gui: [0, 1] |
95 |
| - build_sdist: [0] |
96 |
| - |
97 |
| - env: |
98 |
| - ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
99 |
| - REPO_DIR: . |
100 |
| - BUILD_COMMIT: master |
101 |
| - PROJECT_SPEC: opencv-python |
102 |
| - MB_PYTHON_VERSION: ${{ matrix.python-version }} |
103 |
| - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} |
104 |
| - MB_ML_VER: 2014 |
105 |
| - NP_TEST_DEP: numpy |
106 |
| - TRAVIS_BUILD_DIR: ${{ github.workspace }} |
107 |
| - CONFIG_PATH: travis_config.sh |
108 |
| - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} |
109 |
| - USE_CCACHE: 1 |
110 |
| - UNICODE_WIDTH: 32 |
111 |
| - SDIST: ${{ matrix.build_sdist || 0}} |
112 |
| - ENABLE_HEADLESS: ${{ matrix.without_gui }} |
113 |
| - ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
114 |
| - |
115 |
| - steps: |
116 |
| - - name: Checkout |
117 |
| - uses: actions/checkout@v2 |
118 |
| - with: |
119 |
| - submodules: true |
120 |
| - fetch-depth: 0 |
121 |
| - |
122 |
| - - name: Update submodules |
123 |
| - run: | |
124 |
| - git submodule update --remote |
125 |
| -
|
126 |
| - - name: Set up Python ${{ matrix.python-version }} |
127 |
| - uses: actions/setup-python@v2 |
128 |
| - if: ${{ 'macos-latest' == matrix.os }} |
129 |
| - with: |
130 |
| - python-version: ${{ matrix.python-version }} |
131 |
| - architecture: ${{ matrix.platform }} |
132 |
| - |
133 |
| - - name: Setup Environment variables |
134 |
| - run: | |
135 |
| - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi |
136 |
| - if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi |
137 |
| - if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi |
138 |
| - if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi |
139 |
| - if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi |
140 |
| - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; |
141 |
| - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; |
142 |
| -
|
143 |
| - - name: before install |
144 |
| - run: | |
145 |
| - set -e |
146 |
| - # Check out and prepare the source |
147 |
| - # Multibuild doesn't have releases, so --depth would break eventually (see |
148 |
| - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) |
149 |
| - git submodule update --init multibuild |
150 |
| - source multibuild/common_utils.sh |
151 |
| - # https://github.com/matthew-brett/multibuild/issues/116 |
152 |
| - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi |
153 |
| - source multibuild/travis_steps.sh |
154 |
| - # This sets -x |
155 |
| - # source travis_multibuild_customize.sh |
156 |
| - echo $ENABLE_CONTRIB > contrib.enabled |
157 |
| - echo $ENABLE_HEADLESS > headless.enabled |
158 |
| - set -x |
159 |
| - build_wheel $REPO_DIR $PLAT |
160 |
| - install_run $PLAT |
161 |
| - set +x |
162 |
| - - name: saving artifacts |
163 |
| - uses: actions/upload-artifact@v2 |
164 |
| - with: |
165 |
| - name: wheels |
166 |
| - path: wheelhouse/opencv*.whl |
| 10 | + # build-windows-x86_64: |
| 11 | + # runs-on: ${{ matrix.os }} |
| 12 | + # defaults: |
| 13 | + # run: |
| 14 | + # shell: powershell |
| 15 | + |
| 16 | + # strategy: |
| 17 | + # fail-fast: false |
| 18 | + # matrix: |
| 19 | + # os: [windows-latest] |
| 20 | + # python-version: [3.6, 3.7, 3.8, 3.9] |
| 21 | + # platform: [x86, x64] |
| 22 | + # with_contrib: [0, 1] |
| 23 | + # without_gui: [0, 1] |
| 24 | + # build_sdist: [0] |
| 25 | + |
| 26 | + # env: |
| 27 | + # ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 28 | + # SDIST: ${{ matrix.build_sdist || 0}} |
| 29 | + # ENABLE_HEADLESS: ${{ matrix.without_gui }} |
| 30 | + # ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
| 31 | + |
| 32 | + # steps: |
| 33 | + # - name: Checkout |
| 34 | + # uses: actions/checkout@v2 |
| 35 | + # with: |
| 36 | + # submodules: true |
| 37 | + # fetch-depth: 0 |
| 38 | + |
| 39 | + # - name: Update submodules |
| 40 | + # run: | |
| 41 | + # git submodule update --remote |
| 42 | + |
| 43 | + # - name: Set up Python ${{ matrix.python-version }} |
| 44 | + # uses: actions/setup-python@v2 |
| 45 | + # with: |
| 46 | + # python-version: ${{ matrix.python-version }} |
| 47 | + # architecture: ${{ matrix.platform }} |
| 48 | + |
| 49 | + # - name: Setup MSBuild.exe |
| 50 | + # uses: warrenbuckley/Setup-MSBuild@v1 |
| 51 | + |
| 52 | + # - name: build script |
| 53 | + # run: | |
| 54 | + # python --version |
| 55 | + # python -m pip install --upgrade pip |
| 56 | + # python -m pip install --upgrade setuptools |
| 57 | + # set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose |
| 58 | + # shell: cmd |
| 59 | + |
| 60 | + # - name: before test |
| 61 | + # run: | |
| 62 | + # cd ${{ github.workspace }}/tests |
| 63 | + # &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") |
| 64 | + # if ($LastExitCode -ne 0) {throw $LastExitCode} |
| 65 | + # shell: powershell |
| 66 | + |
| 67 | + # - name: run test |
| 68 | + # run: | |
| 69 | + # cd ${{ github.workspace }}/tests |
| 70 | + # python -m unittest test |
| 71 | + # shell: cmd |
| 72 | + |
| 73 | + # - name: saving artifacts |
| 74 | + # uses: actions/upload-artifact@v2 |
| 75 | + # with: |
| 76 | + # name: wheels |
| 77 | + # path: wheelhouse/opencv*.whl |
| 78 | + |
| 79 | + # build: |
| 80 | + # runs-on: ${{ matrix.os }} |
| 81 | + # defaults: |
| 82 | + # run: |
| 83 | + # shell: bash |
| 84 | + |
| 85 | + # strategy: |
| 86 | + # fail-fast: false |
| 87 | + # matrix: |
| 88 | + # os: [ubuntu-latest, macos-latest] |
| 89 | + # python-version: [3.6, 3.7, 3.8, 3.9] |
| 90 | + # platform: [x64] |
| 91 | + # with_contrib: [0, 1] |
| 92 | + # without_gui: [0, 1] |
| 93 | + # build_sdist: [0] |
| 94 | + |
| 95 | + # env: |
| 96 | + # ACTIONS_ALLOW_UNSECURE_COMMANDS: true |
| 97 | + # REPO_DIR: . |
| 98 | + # BUILD_COMMIT: master |
| 99 | + # PROJECT_SPEC: opencv-python |
| 100 | + # MB_PYTHON_VERSION: ${{ matrix.python-version }} |
| 101 | + # TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} |
| 102 | + # MB_ML_VER: 2014 |
| 103 | + # NP_TEST_DEP: numpy |
| 104 | + # TRAVIS_BUILD_DIR: ${{ github.workspace }} |
| 105 | + # CONFIG_PATH: travis_config.sh |
| 106 | + # DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} |
| 107 | + # USE_CCACHE: 1 |
| 108 | + # UNICODE_WIDTH: 32 |
| 109 | + # SDIST: ${{ matrix.build_sdist || 0}} |
| 110 | + # ENABLE_HEADLESS: ${{ matrix.without_gui }} |
| 111 | + # ENABLE_CONTRIB: ${{ matrix.with_contrib }} |
| 112 | + |
| 113 | + # steps: |
| 114 | + # - name: Checkout |
| 115 | + # uses: actions/checkout@v2 |
| 116 | + # with: |
| 117 | + # submodules: true |
| 118 | + # fetch-depth: 0 |
| 119 | + |
| 120 | + # - name: Update submodules |
| 121 | + # run: | |
| 122 | + # git submodule update --remote |
| 123 | + |
| 124 | + # - name: Set up Python ${{ matrix.python-version }} |
| 125 | + # uses: actions/setup-python@v2 |
| 126 | + # if: ${{ 'macos-latest' == matrix.os }} |
| 127 | + # with: |
| 128 | + # python-version: ${{ matrix.python-version }} |
| 129 | + # architecture: ${{ matrix.platform }} |
| 130 | + |
| 131 | + # - name: Setup Environment variables |
| 132 | + # run: | |
| 133 | + # if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi |
| 134 | + # if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi |
| 135 | + # if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi |
| 136 | + # if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi |
| 137 | + # if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi |
| 138 | + # echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; |
| 139 | + # echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; |
| 140 | + |
| 141 | + # - name: before install |
| 142 | + # run: | |
| 143 | + # set -e |
| 144 | + # # Check out and prepare the source |
| 145 | + # # Multibuild doesn't have releases, so --depth would break eventually (see |
| 146 | + # # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) |
| 147 | + # git submodule update --init multibuild |
| 148 | + # source multibuild/common_utils.sh |
| 149 | + # # https://github.com/matthew-brett/multibuild/issues/116 |
| 150 | + # if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi |
| 151 | + # source multibuild/travis_steps.sh |
| 152 | + # # This sets -x |
| 153 | + # # source travis_multibuild_customize.sh |
| 154 | + # echo $ENABLE_CONTRIB > contrib.enabled |
| 155 | + # echo $ENABLE_HEADLESS > headless.enabled |
| 156 | + # set -x |
| 157 | + # build_wheel $REPO_DIR $PLAT |
| 158 | + # install_run $PLAT |
| 159 | + # set +x |
| 160 | + # - name: saving artifacts |
| 161 | + # uses: actions/upload-artifact@v2 |
| 162 | + # with: |
| 163 | + # name: wheels |
| 164 | + # path: wheelhouse/opencv*.whl |
167 | 165 |
|
168 | 166 |
|
169 | 167 | build_sdist:
|
@@ -247,7 +245,8 @@ jobs:
|
247 | 245 | test_release_opencv_python_all:
|
248 | 246 | needs: [build, build-windows-x86_64, build_sdist]
|
249 | 247 | runs-on: ubuntu-latest
|
250 |
| - environment: test-opencv-python-release |
| 248 | + environment: |
| 249 | + name: test-opencv-python-release |
251 | 250 | steps:
|
252 | 251 | - uses: actions/download-artifact@v2
|
253 | 252 | with:
|
|
0 commit comments