Skip to content

keep up to 10 Preview source files in the MainApplication PreviewCache #540

keep up to 10 Preview source files in the MainApplication PreviewCache

keep up to 10 Preview source files in the MainApplication PreviewCache #540

Workflow file for this run

name: Build Sigil on Windows
on:
push:
branches: [ master ]
tags-ignore:
- '**'
paths-ignore:
- 'docs/**'
- 'installer/win_installer_note.txt'
- 'ChangeLog.txt'
- 'COPYING.txt'
- 'version.xml'
- '.retired_travis.yml'
- '**/**.md'
pull_request:
branches: [ master ]
tags-ignore:
- '**'
paths-ignore:
- 'docs/**'
- 'installer/win_installer_note.txt'
- 'ChangeLog.txt'
- 'COPYING.txt'
- 'version.xml'
- '.retired_travis.yml'
- '**/**.md'
env:
BUILD_TYPE: Release
DOWNLOADQT: https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/MyQtx64_5.12.9_VS2017_WE.7z
GDRIVE: https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/gdrive-windows-x64.exe
GDRIVE_REFRESH_TOKEN: ${{ secrets.GDRIVE_REFRESH_TOKEN }}
GDRIVE_DIR: ${{ secrets.SIGIL_WIN_GDRIVE_DIR }}
QT: MyQtx64_WE\Qt5.12.9
INNO: C:\Program Files (x86)\Inno Setup 6
CMAKE64BIT: -DWIN_INSTALLER_USE_64BIT_CRT=1
PYTHON: \hostedtoolcache\windows\Python\3.9.9\x64
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9.9
uses: actions/setup-python@v2
with:
python-version: 3.9.9
- name: Cache Custom Qt
uses: actions/cache@v2
with:
path: ${{runner.workspace}}\${{env.QT}}
key: ${{ runner.os }}-qtdeps-${{hashFiles('**/reset-win-caches.txt')}}
- name: Install Custom Qt
shell: cmd
run: |
if not exist ${{runner.workspace}}\%QT% cd ${{runner.workspace}} & curl -L -o webkit.7z "%DOWNLOADQT%" & 7z x webkit.7z -y
if exist ${{runner.workspace}}\%QT%\bin cd ${{runner.workspace}}\%QT%\bin & echo [Paths] > qt.conf
if exist ${{runner.workspace}}\%QT%\bin cd ${{runner.workspace}}\%QT%\bin & echo Prefix=.. >> qt.conf
- uses: lukka/get-cmake@latest
#- name: Cache pip modules
# uses: actions/cache@v2
# with:
# path: C:\hostedtoolcache\windows\Python\3.8.6\x64\lib\site-packages
# key: ${{ runner.os }}-pipdeps-${{hashFiles('**/reset-win-caches.txt')}}
- name: Install pip dependencies
shell: cmd
run: |
set PATH=C:\%PYTHON%;C:\%PYTHON%\Scripts;%PATH%
python -m pip install pip==21.0.1
pip install six==1.16.0
pip install html5lib==1.1
pip install regex==2021.11.10
pip install css-parser==1.0.7
pip install cssselect==1.1.0
pip install urllib3==1.26.7
pip install certifi==2021.10.8
pip install dulwich==0.20.26 --global-option="--pure"
pip install chardet==4.0.0
pip install pillow==8.4.0
pip install PyQt5==5.12.3 PyQt5-sip==12.8.1
pip install PyQtWebEngine==5.12.1
pip install lxml==4.7.1
- name: Create Build Environment
shell: cmd
run: |
set PATH=${{runner.workspace}}\%QT%\bin;%PATH%
echo ${{runner.workspace}}
mkdir ${{runner.workspace}}\build
cd ${{runner.workspace}}\build
curl.exe -L -o gdrive.exe "%GDRIVE%"
gdrive.exe version
qmake -v
python --version
- name: Build Sigil
shell: cmd
working-directory: ${{runner.workspace}}\build
run: |
set PATH=C:\%PYTHON%;${{runner.workspace}}\%QT%\bin;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.1
echo %PATH%
cmake %GITHUB_WORKSPACE% ^
-G "Ninja" ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DPYTHON_LIBRARY="C:\%PYTHON%\libs\python39.lib" ^
-DPYTHON_INCLUDE_DIR="C:\%PYTHON%\include" ^
-DPYTHON_EXECUTABLE="C:\%PYTHON%\python.exe" ^
-DUSE_ALT_ICONS=1 ^
-DQt5_DIR="${{runner.workspace}}\$QT\lib\cmake\Qt5" ^
%CMAKE64BIT%
ninja -j2
- name: Build Installer
shell: cmd
working-directory: ${{runner.workspace}}\build
if: "contains(github.event.head_commit.message, '[deploy]')"
run: |
set PATH=C:\%PYTHON%;%INNO%;${{runner.workspace}}\%QT%\bin;%PATH%
set /p RedistVersion=<"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"
set REDIST=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\%RedistVersion%\vcredist_x64.exe
echo "%REDIST%"
cp '%REDIST%' %GITHUB_WORKSPACE%\installer\
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.1
ninja -j2 makeinstaller
- name: Upload to gdrive
shell: cmd
working-directory: ${{runner.workspace}}\build
if: "contains(github.event.head_commit.message, '[deploy]') && github.event_name != 'pull_request'"
run: |
set PATH=C:\%PYTHON%;${{runner.workspace}}\build;%PATH%
python %GITHUB_WORKSPACE%\ci_scripts\newgddeploy.py
- uses: actions/upload-artifact@v2
if: "contains(github.event.head_commit.message, '[deploy]')"
with:
name: sigil-installer
path: ${{runner.workspace}}\build\installer\*.exe
retention-days: 3