-
Notifications
You must be signed in to change notification settings - Fork 0
221 lines (190 loc) · 7.6 KB
/
windows-build.yaml
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Windows build
on: push
jobs:
build-windows-bindings:
name: Build Windows bindings
runs-on: windows-2019-16-core
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Install Visual Studio Build Tools (only needed on windows-latest or runners without VS2019)
# - name: Install Visual Studio Build Tools
# run: |
# choco install visualstudio2019buildtools -y
# choco install visualstudio2019-workload-vctools -y
# shell: cmd
# Step 3: Install Python 3.13
- name: Install Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Add Python to PATH
run: |
setx PATH "%PATH%;C:\hostedtoolcache\windows\Python\3.13.0\x64"
shell: cmd
# Step 4: Add Python to PATH
- name: Install numpy
run: |
C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe -m pip install numpy
shell: cmd
# Step 5: Install MSYS2
- name: Install MSYS2
run: |
choco install msys2 -y
setx PATH "%PATH%;C:\tools\msys64\usr\bin"
shell: cmd
- name: Initialize MSYS2
run: |
C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Syuu --noconfirm"
C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm"
shell: cmd
# Step 6: Install Bazelisk
- name: Install Bazelisk
run: |
choco install bazelisk -y
shell: cmd
# Step 7: Set up Bazel environment variables
- name: Set up Bazel environment variables
env:
BAZEL_VC: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC
BAZEL_VS: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
BAZEL_VC_FULL_VERSION: 14.29.30133
BAZEL_SH: C:\msys64\usr\bin\bash.exe
run: echo "Bazel environment variables set."
# Step 8: Download and Install OpenCV
- name: Download OpenCV
run: |
curl -L -o opencv.exe https://github.com/opencv/opencv/releases/download/4.9.0/opencv-4.9.0-windows.exe
start /wait opencv.exe -suppresslaunch -y -gm2 -o"C:\"
shell: cmd
# Step 9: Install vcpkg and ffmpeg
- name: Install vcpkg and ffmpeg
run: |
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg install ffmpeg
shell: cmd
# Step 10: Download and Install OpenVINO Runtime
- name: Download and Install OpenVINO Runtime 24.5.0
shell: powershell
run: |
Invoke-WebRequest -Uri https://storage.openvinotoolkit.org/repositories/openvino_genai/packages/nightly/2025.0.0.0.dev20241105/openvino_genai_windows_2025.0.0.0.dev20241105_x86_64.zip -OutFile openvino_runtime.zip
Expand-Archive -Path openvino_runtime.zip -DestinationPath C:/Intel/
Rename-Item -Path "C:/Intel/openvino_genai_windows_2024.5.0.0_x86_64" -NewName "openvino_2024.5.0"
dir C:/Intel/openvino_2024.5.0/
# Step 11: Install Mediapipe Requirements
- name: Install Mediapipe Requirements
run: |
C:/tools/msys64/msys2_shell.cmd -defterm -no-start -c "pacman -Sy --noconfirm git patch unzip"
shell: bash
# Step 12: Build with Bazel
- name: Build Windows Bindings with Bazel
env:
PYTHON_BIN_PATH: "C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe"
run: |
cd openvino_bindings
bazel build -c opt :windows_bindings --action_env PYTHON_BIN_PATH="C:/hostedtoolcache/windows/Python/3.13.0/x64/python.exe"
shell: bash
# Step 13: Verify the DLLs
- name: Verify DLLs in Bazel Output
run: |
dir openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar
# Step 14: Upload release artifact
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: windows_bindings.tar
path: openvino_bindings/bazel-out/x64_windows-opt/bin/windows_bindings.tar
build-windows-ui:
name: Build Windows UI
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.0'
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable windows build
run: flutter config --enable-windows-desktop
- name: Copy bindings # Todo
run: |
mkdir bindings
New-Item -ItemType File -Path "bindings\\fake.dll" -Force
- name: Build artifacts
run: flutter build windows --release
- name: Archive Release artifact
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: "OpenVINO-TestDrive-no-bindings-windows.zip"
path: build/windows/x64/runner/Release
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: "OpenVINO-TestDrive-no-bindings-windows.zip"
path: build\\windows\\x64\\runner\\Release
package:
name: Package combined Windows release
runs-on: ubuntu-22.04
needs: [ build-windows-bindings, build-windows-ui ] # Waits for both jobs to succeed
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set filename for release
- name: Set safe filename
id: set_filename
run: |
SAFE_REF_NAME=${GITHUB_REF_NAME//\//_}
echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-windows.zip" >> $GITHUB_ENV
# Step 3: Download artifact from build-windows-ui
- name: Download bindings build artifact
uses: actions/download-artifact@v4
with:
name: "windows_bindings.tar" # Matches the artifact name from build-windows-ui
path: ./bindings # Directory to store the downloaded artifact
# Step 4: Download artifact from build-windows-ui
- name: Download flutter build artifact
uses: actions/download-artifact@v4
with:
name: "OpenVINO-TestDrive-no-bindings-windows.zip" # Matches the artifact name from build-windows-ui
path: ./flutter # Directory to store the downloaded artifact
# Step 5: Combine artifacts
- name: Combine artifacts
run: |
ls -la ./
ls -la ./bindings
ls -la ./flutter
rm -rf ./flutter/fake.dll
tar -xvf ./bindings/windows_bindings.tar -C ./bindings
rm ./bindings/windows_bindings.tar
ls -la ./bindings
mv ./bindings/* ./flutter/
# Step 5: Archive combined folder
- name: Archive Release artifact
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.SANITIZED_FILENAME }}
path: ./flutter/
# Step 5: Upload new artifact
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.SANITIZED_FILENAME }}
path: ./flutter/
# Step 6: Update release
- name: Windows Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.SANITIZED_FILENAME }}