-
Notifications
You must be signed in to change notification settings - Fork 53
191 lines (164 loc) · 6.77 KB
/
msbuild_win7.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
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
name: MSBuild_win7
on:
push:
tags:
- "v*"
pull_request:
tags:
- "v*"
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
jobs:
build:
runs-on: windows-2019
if: github.repository == 'hzqst/CGAssistant'
steps:
- uses: hzqst/[email protected]
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
vs-version: '[15.9,16.12)'
- name: Install Qt
uses: jurplel/[email protected]
with:
version: 5.15.0
host: windows
target: desktop
arch: win32_msvc2019
install-deps: # optional, default is true
modules: # optional
cached: false # ${{ steps.cache-qt.outputs.cache-hit }}
tools : 'tools_qtcreator,9.,qt.tools.qtcreator'
- name: Initialize dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
run: git submodule update --init --recursive
- name: Initialize qhttp
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd qhttp
mkdir 3rdparty
cd 3rdparty
git clone https://github.com/nodejs/http-parser.git
shell: cmd
- name: Initialize boost
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd boost
bootstrap.bat
shell: cmd
- name: Build boost
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x86 -winsdk=10.0.17763.0
cd boost
b2 --toolset=msvc-14.2 --with-date_time --with-thread --with-container --with-system --with-locale --with-serialization --with-regex --stagedir="stage" link=static variant=release address-model=32 stage
b2 --toolset=msvc-14.2 --with-date_time --with-thread --with-container --with-system --with-locale --with-serialization --with-regex --stagedir="stage" runtime-link=static link=static variant=release address-model=32 stage
)
shell: cmd
- name: Build CGAHook
working-directory: ${{env.GITHUB_WORKSPACE}}
run: MSBuild.exe CGAssistant.sln /t:CGAHook /p:Configuration=Release /p:Platform="x86" /p:PlatformToolset=v142
- name: Build qhttp
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x86 -winsdk=10.0.17763.0
cd qhttp
qmake qhttp.pro -spec win32-msvc "CONFIG+=32bit" "CONFIG+=qtquickcompiler release" "INCLUDEPATH+=%GITHUB_WORKSPACE%\winsdk\Include\10.0.17763.0\ucrt" "LIBS += -L%GITHUB_WORKSPACE%\winsdk\Lib\10.0.17763.0\um\x86" "LIBS += -L%GITHUB_WORKSPACE%\winsdk\Lib\10.0.17763.0\ucrt\x86"
"${{env.Qt5_Dir}}/../../Tools/QtCreator/bin/jom/jom.exe" -f MakeFile qmake_all
"${{env.Qt5_Dir}}/../../Tools/QtCreator/bin/jom/jom.exe"
copy "%GITHUB_WORKSPACE%\qhttp\xbin\qhttp.dll" "%GITHUB_WORKSPACE%\build\"
)
shell: cmd
- name: Build CGAssistant
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
"%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x86 -winsdk=10.0.17763.0
cd CGAssistant
qmake CGAssistant.pro -spec win32-msvc "CONFIG+=32bit" "CONFIG+=qtquickcompiler release" "INCLUDEPATH+=%GITHUB_WORKSPACE%\winsdk\Include\10.0.17763.0\ucrt" "LIBS += -L%GITHUB_WORKSPACE%\winsdk\Lib\10.0.17763.0\um\x86" "LIBS += -L%GITHUB_WORKSPACE%\winsdk\Lib\10.0.17763.0\ucrt\x86"
"${{env.Qt5_Dir}}/../../Tools/QtCreator/bin/jom/jom.exe" -f MakeFile qmake_all
"${{env.Qt5_Dir}}/../../Tools/QtCreator/bin/jom/jom.exe"
copy "%GITHUB_WORKSPACE%\CGassistant\release\CGassistant.exe" "%GITHUB_WORKSPACE%\build\"
)
shell: cmd
- name: Setup node environment
uses: actions/setup-node@v2
with:
node-version: '14.16'
architecture: 'x86'
- name: Install node-gyp
working-directory: ${{env.GITHUB_WORKSPACE}}
run: npm install -g node-gyp
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.1.4'
architecture: 'x86'
- name: Set NODE_GYP_FORCE_PYTHON Environment Variable
run: echo "NODE_GYP_FORCE_PYTHON=$(python -c "import sys; print(sys.executable)")" >> $Env:GITHUB_ENV
shell: powershell
- name: Build node-gyp
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build-nodegyp.bat
shell: cmd
env:
NODE_GYP_FORCE_PYTHON: ${{ env.NODE_GYP_FORCE_PYTHON }}
- name: Deploy qt and msvc redistribution
working-directory: ${{env.GITHUB_WORKSPACE}}
run: windeploy.bat
shell: cmd
- name: Create Output directory
working-directory: ${{env.GITHUB_WORKSPACE}}
run: mkdir Output
shell: cmd
- name: Copy Build to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
copy "node.exe" "Output" /y
xcopy "build" "Output" /y /e
shell: cmd
- name: Checkout CGAssistantJS
uses: hzqst/checkout@main
with:
repository: 'hzqst/CGAssistantJS'
path: 'CGAssistantJS'
- name: npm install in CGAssistantJS
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
cd CGAssistantJS
npm install
shell: cmd
- name: Copy CGAssistantJS to Output
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
chcp 936
xcopy "CGAssistantJS" "Output" /y /e
shell: cmd
- name: Zipping All
uses: hzqst/action-zip@master
with:
files: Output/
dest: CGAssistant-windows-x86-win7.zip
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: CGAssistant-${{ github.ref }}
files: |
CGAssistant-windows-x86-win7.zip