-
Notifications
You must be signed in to change notification settings - Fork 581
139 lines (123 loc) · 4.64 KB
/
win-build.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
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/Qt6.5.3_x64_VS2022.7z
QT: Qt6.5.3
INNO: C:\Program Files (x86)\Inno Setup 6
CMAKE64BIT: -DWIN_INSTALLER_USE_64BIT_CRT=1
PYTHON: \hostedtoolcache\windows\Python\3.11.3\x64
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11.3
uses: actions/setup-python@v4
with:
python-version: 3.11.3
- name: Cache Custom Qt
uses: actions/cache@v3
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 qt.7z "%DOWNLOADQT%" & 7z x qt.7z -y
- uses: lukka/get-cmake@latest
- name: Install pip dependencies
shell: cmd
run: |
set PATH=C:\%PYTHON%;C:\%PYTHON%\Scripts;%PATH%
python -m pip install --upgrade pip
pip install six==1.16.0
pip install html5lib==1.1
pip install regex==2023.3.23
pip install css-parser==1.0.8
pip install cssselect==1.2.0
pip install urllib3==1.26.15
pip install certifi==2022.12.7
pip install dulwich==0.21.3
pip install chardet==5.1.0
pip install pillow==9.5.0
pip install lxml==4.9.2
pip install shiboken6@https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/shiboken6-6.5.3-6.5.3-cp311-cp311-win_amd64.whl
pip install PySide6@https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/PySide6-6.5.3-6.5.3-cp311-cp311-win_amd64.whl
- 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
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\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.37
echo %PATH%
cmake %GITHUB_WORKSPACE% ^
-G "Ninja" ^
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
-DPYTHON_LIBRARY="C:\%PYTHON%\libs\python311.lib" ^
-DPYTHON_INCLUDE_DIR="C:\%PYTHON%\include" ^
-DPYTHON_EXECUTABLE="C:\%PYTHON%\python.exe" ^
-DUSE_ALT_ICONS=1 ^
-DQt6_DIR="${{runner.workspace}}\$QT\lib\cmake\Qt6" ^
%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\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"
set REDIST=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\%RedistVersion%\vc_redist.x64.exe
echo "%REDIST%"
cp '%REDIST%' %GITHUB_WORKSPACE%\installer\vcredist_x64.exe
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.37
ninja -j2 makeinstaller
# RIP gdrive
#- 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@v3
if: "contains(github.event.head_commit.message, '[deploy]')"
with:
name: sigil-installer
path: ${{runner.workspace}}\build\installer\*.exe
retention-days: 5