Skip to content

Try Fix Syntax Errow #6

Try Fix Syntax Errow

Try Fix Syntax Errow #6

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 --version=1.74.0
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
cd toonz/build/
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