Skip to content

Commit ff2c568

Browse files
committed
Github action
1 parent fd4e604 commit ff2c568

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/BuildPR.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: PullRequest
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
buildMac:
13+
name: Build macOS
14+
runs-on: macOS-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
xcode: [ Xcode_12.3 ]
19+
sourceDist: [ 1,0 ]
20+
steps:
21+
- name: Checkout
22+
uses: actions/[email protected]
23+
with:
24+
fetch-depth: 0
25+
submodules: true
26+
- name: Prepare (before_install)
27+
run: |
28+
source multibuild/common_utils.sh
29+
source multibuild/travis_steps.sh
30+
source travis_multibuild_customize.sh
31+
echo $ENABLE_CONTRIB > contrib.enabled
32+
echo $ENABLE_HEADLESS > headless.enabled
33+
cat contrib.enabled
34+
- name: check
35+
run: |
36+
brew install python
37+
python --version
38+
pip --version
39+
export PATH=/usr/local/opt/python/libexec/bin:$PATH
40+
python --version
41+
pip --version
42+
- name: Install
43+
run: |
44+
export PATH=/usr/local/opt/python/libexec/bin:$PATH
45+
if [[ ${{ matrix.sourceDist }} == 1 ]]; then
46+
python -m pip install --upgrade pip
47+
python -m pip install scikit-build
48+
python setup.py sdist
49+
else
50+
build_wheel $REPO_DIR $PLAT
51+
fi
52+
- name: build
53+
run: |
54+
export PATH=/usr/local/opt/python/libexec/bin:$PATH
55+
if [[ ${{ matrix.sourceDist }} == 1 ]]; then
56+
echo "skipping tests because of $sourceDist"
57+
else
58+
install_run $PLAT
59+
fi
60+
- name: post
61+
run: |
62+
export PATH=/usr/local/opt/python/libexec/bin:$PATH
63+
# macpython 3.5 doesn't support recent TLS protocols which causes twine
64+
# upload to fail, so we use the system Python to run twine
65+
/usr/bin/python -m ensurepip --user
66+
/usr/bin/python -m pip install --user -U pip
67+
/usr/bin/python -m pip install --user -U -I twine
68+
69+
if [[ ${{ matrix.sourceDist }} == 1 ]]; then
70+
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv*
71+
else
72+
/usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv*
73+
fi
74+
# - name: Archive artifact
75+
# uses: actions/[email protected]
76+
# if: ${{ success() }}
77+
# with:
78+
# name: openCV-python-${{ matrix.xcode }}
79+
# path: build/release

0 commit comments

Comments
 (0)