-
-
Notifications
You must be signed in to change notification settings - Fork 39
217 lines (196 loc) · 8.13 KB
/
windows-ci.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
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
name: Windows CI
on:
push:
branches:
- master
- stable
pull_request:
branches:
- master
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/"
}
- {
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-8.1.0-release-posix-dwarf-rt_v6-rev0.7z", mingw_install_dir: "C:/MinGW-w64/",
qt_download: "https://wohlsoft.ru/docs/Software/QtBuilds/Qt-5.6.3-i686-mingw-w64-8.1.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/"
}
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/[email protected]
- 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 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: Deploy to builds.wohlsoft.ru
if: success() && github.event_name != 'pull_request' && 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