-
-
Notifications
You must be signed in to change notification settings - Fork 41
257 lines (231 loc) · 9.89 KB
/
windows-ci.yml
File metadata and controls
257 lines (231 loc) · 9.89 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: Windows CI
on:
push:
branches:
- master
- stable
- wip-xtconvert
pull_request:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "${{ matrix.config.name }} | ${{ matrix.config.build_type }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "64-bit",
os: windows-latest,
PLATFORM: x64,
WINXX_ARCH: win64,
extra_path: "/c/Qt/5.15.10-x64/bin:/c/MinGW-w64/mingw64/bin",
extra_options: "-DCMAKE_PREFIX_PATH=\"C:/Qt/5.15.10-x64/\" -DCMAKE_TOOLCHAIN_FILE=`pwd`/_common/ci_windows_mingw_toolchain_x64.cmake",
build_type: "Release",
upload_directory: "www/win32/moondust-win64/",
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/x86_64-13.1.0-release-posix-seh-msvcrt-rt_v11-rev1.7z", mingw_install_dir: "C:/MinGW-w64/",
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.15.10-x64-mingw-w64-13.1.0-shared-release.7z", qt_install_dir: "C:/Qt/",
qt_dir: "C:/Qt/5.15.10-x64/bin",
ninja_download: "https://wohlsoft.ru/docs/Software/Ninja-Build/ninja-win.zip", ninja_install_dir: "C:/MinGW-w64/mingw64/bin",
lftp_download: "https://wohlsoft.ru/docs/Software/lftp-4.4.15.win64-openssl-1.0.1g.7z", lftp_install_dir: "C:/MinGW-w64/mingw64/",
libxz_download: "https://wohlsoft.ru/docs/Software/MinGW/mingw-w64-x86_64-xz-5.6.4-1-any.7z", libxz_install_dir: "C:/MinGW-w64/mingw64/",
libgnurx_download: "https://wohlsoft.ru/docs/Software/MinGW/mingw-w64-x86_64-libgnurx-2.5.1-3-any.7z", libgnurx_install_dir: "C:/MinGW-w64/mingw64/"
}
- {
name: "32-bit",
os: windows-latest,
PLATFORM: Win32,
WINXX_ARCH: win32,
extra_path: "/c/Qt/5.6.3-i686/bin:/c/MinGW-w64/mingw32/bin",
extra_options: "-DCMAKE_PREFIX_PATH=\"C:/Qt/5.6.3-i686/\" -DCMAKE_TOOLCHAIN_FILE=`pwd`/_common/ci_windows_mingw_toolchain_x32.cmake",
build_type: "Release",
upload_directory: "www/win32/moondust-win32/",
mingw_download: "https://wohlsoft.ru/docs/Software/MinGW/i686-12.2.0-release-posix-dwarf-rt_v10-rev1.7z", mingw_install_dir: "C:/MinGW-w64/",
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.6.3-i686-mingw-w64-12.2.0-shared-release.7z", qt_install_dir: "C:/Qt/",
qt_dir: "C:/Qt/5.6.3-i686/bin",
ninja_download: "https://wohlsoft.ru/docs/Software/Ninja-Build/ninja-win.zip", ninja_install_dir: "C:/MinGW-w64/mingw32/bin",
lftp_download: "https://wohlsoft.ru/docs/Software/lftp-4.4.15.win64-openssl-1.0.1g.7z", lftp_install_dir: "C:/MinGW-w64/mingw32/",
libxz_download: "https://wohlsoft.ru/docs/Software/MinGW/mingw-w64-i686-xz-5.6.4-1-any.7z", libxz_install_dir: "C:/MinGW-w64/mingw32/",
libgnurx_download: "https://wohlsoft.ru/docs/Software/MinGW/mingw-w64-i686-libgnurx-2.5.1-3-any.7z", libgnurx_install_dir: "C:/MinGW-w64/mingw32/"
}
steps:
- name: Check for the upload support
id: upload-check
shell: bash
run: |
if [[ "${{ secrets.builds_login }}" != '' && \
"${{ secrets.builds_password }}" != '' && \
"${{ secrets.builds_host }}" != '' ]]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- uses: actions/checkout@v3
with:
fetch-depth: 3
submodules: recursive
- uses: Wohlstand/branch-name@v1.0.1-wohl
- name: Check if a pull request
id: event-check
shell: bash
run: |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then
echo "--- This build is a pull-request ---"
echo "is_pull_request=true" >> $GITHUB_OUTPUT;
else
echo "--- This build is a normal branch build ---"
echo "is_pull_request=false" >> $GITHUB_OUTPUT;
fi
- name: Download MinGW
if: matrix.config.mingw_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.mingw_download }}"
file-name: mingw.7z
- name: Extract MinGW
if: matrix.config.mingw_install_dir
shell: bash
run: |
7z x mingw.7z -o"${{ matrix.config.mingw_install_dir }}"
- name: Download libxz
if: matrix.config.libxz_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.libxz_download }}"
file-name: libxz.7z
- name: Extract libxz
if: matrix.config.libxz_install_dir
shell: bash
run: |
7z x libxz.7z bin lib include -o"${{ matrix.config.libxz_install_dir }}"
- name: Download libgnurx
if: matrix.config.libgnurx_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.libgnurx_download }}"
file-name: libgnurx.7z
- name: Extract libgnurx
if: matrix.config.libgnurx_install_dir
shell: bash
run: |
7z x libgnurx.7z bin lib include -o"${{ matrix.config.libgnurx_install_dir }}"
- name: Download Qt
if: matrix.config.qt_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.qt_download }}"
file-name: qt.7z
- name: Extract Qt
if: matrix.config.qt_install_dir
shell: bash
run: |
7z x qt.7z -o"${{ matrix.config.qt_install_dir }}"
- name: Download Ninja
if: matrix.config.ninja_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.ninja_download }}"
file-name: ninja.zip
- name: Extract Ninja
if: matrix.config.ninja_install_dir
shell: bash
run: |
7z x ninja.zip -o"${{ matrix.config.ninja_install_dir }}"
- name: Download LFTP
if: matrix.config.lftp_download
uses: carlosperate/download-file-action@v2
with:
file-url: "${{ matrix.config.lftp_download }}"
file-name: lftp.7z
- name: Extract LFTP
if: matrix.config.lftp_install_dir
shell: bash
run: |
7z x lftp.7z bin etc -o"${{ matrix.config.lftp_install_dir }}"
- name: Configure
shell: bash
run: |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then
export PATH=${{ matrix.config.extra_path }}:${PATH}
export QT_DIR="${{ matrix.config.qt_dir }}"
export QtDir="${{ matrix.config.qt_dir }}"
echo "PATH environment: ${PATH}"
fi
echo "====================================="
qmake --version
echo "====================================="
gcc --version
echo "====================================="
git --version
echo "====================================="
cmake --version
echo "====================================="
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DCMAKE_INSTALL_PREFIX="`pwd`/bin-cmake-release" -DPGE_INSTALL_DIRECTORY="PGE_Project" ${{ matrix.config.extra_options }} .
- name: Build
shell: bash
run: |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then
export PATH=${{ matrix.config.extra_path }}:${PATH}
export QT_DIR="${{ matrix.config.qt_dir }}"
export QtDir="${{ matrix.config.qt_dir }}"
fi
export MAKEFLAGS=--keep-going
cmake --build build --target all --config ${{ matrix.config.build_type }} --parallel 3
- name: Install
shell: bash
run: |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then
export PATH=${{ matrix.config.extra_path }}:${PATH}
export QT_DIR="${{ matrix.config.qt_dir }}"
export QtDir="${{ matrix.config.qt_dir }}"
fi
export MAKEFLAGS=--keep-going
cmake --build build --target install --config ${{ matrix.config.build_type }}
- name: Deploy
shell: bash
run: |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then
export PATH=${{ matrix.config.extra_path }}:${PATH}
export QT_DIR="${{ matrix.config.qt_dir }}"
export QtDir="${{ matrix.config.qt_dir }}"
fi
export MAKEFLAGS=--keep-going
cmake --build build --target windeploy --config ${{ matrix.config.build_type }}
cmake --build build --target enable_portable
cmake --build build --target put_online_help
cmake --build build --target create_zip
cmake --build build --target create_zip_tools
cmake --build build --target create_zip_install
mkdir _packed
mv bin-cmake-release/_packed/*.zip _packed
- name: Upload artifact
if: success() && steps.upload-check.outputs.available == 'true'
uses: actions/upload-artifact@v4
continue-on-error: true
with:
path: _packed/*.zip
name: ${{ matrix.config.name }} ${{ matrix.config.build_type }}
- name: Deploy to builds.wohlsoft.ru
if: success() && github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && steps.event-check.outputs.is_pull_request == 'false' && steps.upload-check.outputs.available == 'true'
shell: bash
run: |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then
export PATH=${{ matrix.config.extra_path }}:${PATH}
fi
UPLOAD_LIST="set ssl:verify-certificate no;"
for q in ./_packed/*.zip; do
UPLOAD_LIST="${UPLOAD_LIST} put -O ${{ matrix.config.upload_directory }} $q;"
done
lftp -e "${UPLOAD_LIST} exit" -u ${{ secrets.builds_login }},${{ secrets.builds_password }} ${{ secrets.builds_host }}
- name: List Build Directory
if: always()
shell: bash
run: |
git status
ls -lR build