forked from opentoonz/opentoonz
-
Notifications
You must be signed in to change notification settings - Fork 1
150 lines (121 loc) · 5.4 KB
/
workflow_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
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
name: Windows Build
on:
push:
branches:
- master # Specify branches where the workflow should run
pull_request: # Here no specific branches are listed to allow all pull requests to generate a workflow run
jobs:
Windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install and Configure ccache
run: |
@echo on
choco install ccache
copy C:\ProgramData\chocolatey\lib\ccache\tools\ccache*\ccache.exe C:\ProgramData\chocolatey\bin\cl.exe
mkdir %LOCALAPPDATA%\ccache
shell: cmd
- name: Set Path ccache
uses: actions/cache@v4
with:
path: C:/Users/runneradmin/AppData/Local/ccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-
- name: Install OpenCV and Boost
run: |
@echo on
REM install opencv
choco install opencv --version=4.5.1
REM install boost
choco install boost-msvc-14.2
shell: cmd
- name: Install custom Qt 5.15.2 with WinTab support
run: |
@echo on
mkdir thirdparty\qt
curl -fsSL -o Qt5.15.2_wintab.zip https://github.com/shun-iwasawa/qt5/releases/download/v5.15.2_wintab/Qt5.15.2_wintab.zip
7z x Qt5.15.2_wintab.zip
move Qt5.15.2_wintab\5.15.2_wintab thirdparty\qt
shell: cmd
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: CMake configuration
run: |
@echo on
cd thirdparty
REM Copy headers
copy /Y tiff-4.0.3\libtiff\tif_config.vc.h tiff-4.0.3\libtiff\tif_config.h
copy /Y tiff-4.0.3\libtiff\tiffconf.vc.h tiff-4.0.3\libtiff\tiffconf.h
copy /Y libpng-1.6.21\scripts\pnglibconf.h.prebuilt libpng-1.6.21\pnglibconf.h
cd ../toonz
IF NOT EXIST build mkdir build
cd build
REM Setup for local builds
set MSVCVERSION="Visual Studio 16 2019"
set BOOST_ROOT=C:\boost\boost_1_74_0
set OPENCV_DIR=C:\opencv\451\build
set QT_PATH=C:\Qt\5.15.2_wintab\msvc2019_64
REM These are effective when running from Actions
IF EXIST C:\local\boost_1_74_0 set BOOST_ROOT=C:\local\boost_1_74_0
IF EXIST C:\tools\opencv set OPENCV_DIR=C:\tools\opencv\build
set WITH_WINTAB=Y
IF EXIST D:\a\opentoonz\opentoonz\thirdparty\qt\5.15.2_wintab\msvc2019_64 (
set QT_PATH=D:\a\opentoonz\opentoonz\thirdparty\qt\5.15.2_wintab\msvc2019_64
)
cmake ..\sources -G %MSVCVERSION% -Ax64 -DQT_PATH=%QT_PATH% -DBOOST_ROOT=%BOOST_ROOT% -DOpenCV_DIR=%OPENCV_DIR% -DWITH_WINTAB=%WITH_WINTAB%
shell: cmd
- name: Build Opentoonz
run: |
@echo on
IF EXIST C:\ProgramData\chocolatey\bin\cl.exe (
msbuild /p:CLToolPath=C:\ProgramData\chocolatey\bin /p:UseMultiToolTask=true /p:Configuration=RelWithDebInfo /m /verbosity:minimal ALL_BUILD.vcxproj
) ELSE (
msbuild /p:Configuration=RelWithDebInfo /m /verbosity:minimal ALL_BUILD.vcxproj
)
shell: cmd
- name: Create Package
run: |
@echo on
cd ../..
cd toonz\build
IF EXIST Opentoonz rmdir /S /Q Opentoonz
mkdir Opentoonz
Rem Copy and configure Opentoonz installation
copy /y RelWithDebInfo\*.* Opentoonz
copy /Y ..\..\thirdparty\glut\3.7.6\lib\glut64.dll Opentoonz
copy /Y ..\..\thirdparty\glew\glew-1.9.0\bin\64bit\glew32.dll Opentoonz
copy /Y ..\..\thirdparty\libmypaint\dist\64\libiconv-2.dll Opentoonz
copy /Y ..\..\thirdparty\libmypaint\dist\64\libintl-8.dll Opentoonz
copy /Y ..\..\thirdparty\libmypaint\dist\64\libjson-c-2.dll Opentoonz
copy /Y ..\..\thirdparty\libmypaint\dist\64\libmypaint-1-4-0.dll Opentoonz
IF EXIST C:\tools\opencv (
copy /Y "C:\tools\opencv\build\x64\vc14\bin\opencv_world451.dll" Opentoonz
) ELSE (
copy /Y "C:\opencv\451\build\x64\vc14\bin\opencv_world451.dll" Opentoonz
)
REM Remove PDB files
del Opentoonz\*.pdb
REM Configuring Opentoonz.exe for deployment
set QT_PATH=C:\Qt\5.15.2_wintab\msvc2019_64
IF EXIST D:\a\opentoonz\opentoonz\thirdparty\qt\5.15.2_wintab\msvc2019_64 set QT_PATH=D:\a\opentoonz\opentoonz\thirdparty\qt\5.15.2_wintab\msvc2019_64
set VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC"
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" set VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC"
%QT_PATH%\bin\windeployqt.exe Opentoonz\Opentoonz.exe --opengl
REM Creating Opentoonz Windows Portable package
IF EXIST Opentoonz\portablestuff rmdir /S /Q Opentoonz\portablestuff
REM Copy stuff files directly to portablestuff
xcopy /Y /E /I ..\..\stuff Opentoonz\portablestuff
cd ..\..
shell: cmd
- name: Create Artifact
run: |
mkdir artifact
cp -r toonz\build\Opentoonz artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Opentoonz-${{ runner.os }}-${{ github.sha }}
path: artifact