-
Notifications
You must be signed in to change notification settings - Fork 1.2k
174 lines (154 loc) · 7.11 KB
/
ci-win.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
name: CI-Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
env:
VNOTE_VER: 3.17.0
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: windows-2019
timeout-minutes: 120
strategy:
matrix:
config:
- {
name: "Build On Win64 Qt 6.5",
arch: win64_msvc2019_64,
platform: x64,
qt: 6.5.2
}
- {
name: "Build On Win32 Qt 6.5",
arch: win32_msvc2019,
platform: x86,
qt: 6.5.2
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE.
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Init Submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1 # not v2!
with:
path: ../Qt
key: ${{ runner.os }}-${{matrix.config.arch}}-QtCache-6.5
- name: Install Qt Official Build
uses: jurplel/install-qt-action@v3
with:
version: ${{matrix.config.qt}}
target: desktop
arch: ${{matrix.config.arch}}
modules: qtwebengine
tools: tools_openssl_${{matrix.config.platform}},3.0.10,qt.tools.openssl.win_${{matrix.config.platform}}
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Create Build Dir
shell: bash
run: mkdir build
working-directory: ${{runner.workspace}}
- name: Clone OpenSSL
shell: bash
run: |
git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git --depth=1
working-directory: ${{runner.workspace}}/build
- name: Configure and Build Project
shell: cmd
run: |
qmake --version
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.config.platform}}
qmake -r -spec win32-msvc CONFIG-=debug CONFIG+=release %GITHUB_WORKSPACE%\vnote.pro
nmake
working-directory: ${{runner.workspace}}/build
- name: Package Project
shell: cmd
run: |
qmake --version
mkdir "%DISTRIB_PATH%"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.config.platform}}
windeployqt.exe --dir "%DISTRIB_PATH%" .\src\release\vnote.exe
copy .\src\release\vnote.exe "%DISTRIB_PATH%\vnote.exe"
copy .\src\release\vnote_extra.rcc "%DISTRIB_PATH%\vnote_extra.rcc"
copy .\libs\vtextedit\src\libs\syntax-highlighting\release\VSyntaxHighlighting.dll "%DISTRIB_PATH%\VSyntaxHighlighting.dll"
copy .\libs\vtextedit\src\editor\release\VTextEdit.dll "%DISTRIB_PATH%\VTextEdit.dll"
rem set qt_dir=%Qt5_Dir:/=\%
rem for %%I in ("%qt_dir%\..\..") do set "qt_topdir=%%~fI"
rem set openssl_dir=%qt_topdir%\Tools\OpenSSL\Win_${{matrix.config.platform}}\bin
set openssl_dir=openssl-utils.git\1.1.1j\Win_${{matrix.config.platform}}
copy %openssl_dir%\lib*.dll "%DISTRIB_PATH%\"
copy "%GITHUB_WORKSPACE%\README.md" "%DISTRIB_PATH%\README.md"
copy "%GITHUB_WORKSPACE%\COPYING.LESSER" "%DISTRIB_PATH%\COPYING.LESSER"
echo %GITHUB_SHA% > "%DISTRIB_PATH%\commit"
del /F /Q "%DISTRIB_PATH%\translations\qt_*.qm"
7z a vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip "%DISTRIB_PATH%"
copy vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.zip
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote
- name: Package Installer
shell: cmd
run: |
copy "%GITHUB_WORKSPACE%\src\data\core\icons\vnote.ico" "%DISTRIB_PATH%\vnote.ico"
git clone https://github.com/vnotex/mkmsi.git mkmsi.git --depth=1
python .\mkmsi.git\mkmsi.py --auto-create qt --source-dir "%DISTRIB_PATH%" --wix-root "C:\Program Files (x86)\WiX Toolset v3.11" --merge-module "C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC140_CRT_${{matrix.config.platform}}.msm" --add-desktop-shortcut --project-version ${{env.VNOTE_VER}} --license %GITHUB_WORKSPACE%\package\lgpl-3.0.rtf --executable vnote.exe --wix-banner %GITHUB_WORKSPACE%\package\wix_banner.png --wix-dialog %GITHUB_WORKSPACE%\package\wix_dialog.png VNote
move VNote.msi .\distrib\VNote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.msi
del "%DISTRIB_PATH%\vnote.ico"
working-directory: ${{runner.workspace}}/build
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}
path: ${{env.DISTRIB_PATH}}
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote
- name: Archive Installer
uses: actions/upload-artifact@v2
with:
name: VNote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.msi
path: ${{runner.workspace}}/build/distrib/VNote*.msi
env:
DISTRIB_PATH: ${{runner.workspace}}/build/distrib/vnote
- name: Update Tag
if: github.ref == 'refs/heads/master'
shell: bash
run: |
git tag --force continuous-build ${GITHUB_SHA}
git push --force --tags
- name: Update Continuous Build Release
if: github.ref == 'refs/heads/master'
uses: johnwbyrd/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{runner.workspace}}/build/vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}.zip
release: Continuous Build
tag: continuous-build
- name: Test
shell: cmd
run: |
dir .
dir .\distrib
working-directory: ${{runner.workspace}}/build
- name: Release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, '[Release]')
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# We need hard code here.
artifacts: "D:/a/vnote/build/vnote-win-${{matrix.config.platform}}-qt${{matrix.config.qt}}_v${{env.VNOTE_VER}}.zip"
commit: master
tag: v${{env.VNOTE_VER}}
allowUpdates: true
draft: true