forked from nrl-ai/daisykit
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 3.24 KB
/
wheels-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Wheel builder Windows
on:
# pull_request:
# branches:
# - master
# release:
# types: [published, edited]
workflow_dispatch:
jobs:
build-windows-x86_64:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: powershell
strategy:
fail-fast: false
matrix:
os: [windows-2019]
python-version: ['3.7', '3.8', '3.9', '3.10']
platform: [x64]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: false
fetch-depth: 0
- name: Update submodules
# if: github.event_name == 'pull_request'
run: git submodule update --remote
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform }}
- name: Get CMake
uses: lukka/get-cmake@latest
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: Restore vcpkg and its artifacts.
uses: actions/cache@v2
id: vcpkg-cache
with:
path: |
${{ env.VCPKG_ROOT }}
${{ github.workspace }}/build/vcpkg_installed
!${{ env.VCPKG_ROOT }}/.git
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
key: |
${{ hashFiles( 'vcpkg.json' ) }}-cache-key-v1
- name: Get vcpkg(windows)
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }}
run: |
cd ${{ github.workspace }}
mkdir build -force
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
- name: Install OpenCV
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }}
run: |
cd ${{ github.workspace }}
vcpkg install opencv:x64-windows
- name: Build a package
run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v
shell: cmd
env:
OpenCV_DIR: ${{ github.workspace }}/ext/vcpkg/installed/x64-windows/share/opencv
- name: Saving all wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/opencv*.whl
release_daisykit:
# if: github.event_name == 'release' && !github.event.release.prerelease
needs: [build-windows-x86_64] #,test
runs-on: ubuntu-latest
environment: opencv-python-release
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: wheelhouse/
- name: Upload wheels for daisykit
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.DAISYKIT_PYPI_USERNAME }} -p ${{ secrets.DAISYKIT_PYPI_PASSWORD }} --skip-existing wheelhouse/daisykit-*