forked from copperspice/copperspice
-
Notifications
You must be signed in to change notification settings - Fork 0
322 lines (288 loc) · 10.6 KB
/
davenche.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
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
name: 'davenche'
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [ push ]
env:
MODULE_NAME: CopperSpice
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- { group: cs-ubuntu-22.04, artifact-tag: jammy-gcc, build-type: debug }
- { group: cs-ubuntu-22.04, artifact-tag: jammy-gcc, build-type: release }
- { group: cs-windows-2022, artifact-tag: windows-cl, build-type: debug }
- { group: cs-windows-2022, artifact-tag: windows-cl, build-type: release }
runs-on: ${{ matrix.config.group }}
steps:
- name: Install Core Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -qq
sudo apt install -y cmake
sudo apt install -y ninja-build
sudo apt install -y libaudio-dev
sudo apt install -y libc6-dev
sudo apt install -y libfontconfig1-dev
sudo apt install -y libfreetype6-dev
sudo apt install -y libgl1-mesa-dev
sudo apt install -y libglib2.0-dev
sudo apt install -y libunwind-dev
sudo apt install -y libgstreamer-plugins-base1.0-dev
sudo apt install -y libgstreamer1.0-dev
sudo apt install -y libice-dev
sudo apt install -y libsm-dev
sudo apt install -y libx11-dev
sudo apt install -y libx11-xcb-dev
sudo apt install -y libxcb-glx0-dev
sudo apt install -y libxcb-icccm4-dev
sudo apt install -y libxcb-image0-dev
sudo apt install -y libxcb-keysyms1-dev
sudo apt install -y libxcb-randr0-dev
sudo apt install -y libxcb-render-util0-dev
sudo apt install -y libxcb-render0-dev
sudo apt install -y libxcb-shape0-dev
sudo apt install -y libxcb-shm0-dev
sudo apt install -y libxcb-sync-dev
sudo apt install -y libxcb-xfixes0-dev
sudo apt install -y libxcb-xinerama0-dev
sudo apt install -y libxcb-xkb-dev
sudo apt install -y libxcb1-dev
sudo apt install -y libxcursor-dev
sudo apt install -y libxext-dev
sudo apt install -y libxfixes-dev
sudo apt install -y libxi-dev
sudo apt install -y libxinerama-dev
sudo apt install -y libxkbcommon-dev
sudo apt install -y libxkbcommon-x11-dev
sudo apt install -y libxrandr-dev
sudo apt install -y libxrender-dev
- name: Get top commit details
uses: actions/[email protected]
id: author-date
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commit_details = await github.git.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha });
return commit_details.data.author.date
- name: Setup environment
shell: bash
run: |
git config --global core.autocrlf input
echo "ARTIFACT_NAME=${{ env.MODULE_NAME }}_${{ matrix.config.artifact-tag }}_${{ matrix.config.build-type }}" >> $GITHUB_ENV
- name: Move builds to C:\ drive
if: runner.os == 'Windows'
shell: cmd
run: |
mkdir C:\${{ env.MODULE_NAME }}
cd /D C:\${{ env.MODULE_NAME }}
rd /S /Q %GITHUB_WORKSPACE%
mklink /D %GITHUB_WORKSPACE% C:\${{ env.MODULE_NAME }}
- name: Git pull
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Build
if: runner.os == 'Linux'
env:
CC: gcc-11
CXX: g++-11
run: |
env
which cmake && cmake --version
which ninja && ninja --version
which $CC && $CC --version
which $CXX && $CXX --version
if [[ "${{ matrix.config.build-type }}" == "debug" ]]; then
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=out/install \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
-DWITH_MULTIMEDIA=OFF \
-DWITH_SQL=OFF \
-DWITH_WEBKIT=OFF \
-DWITH_PSQL_PLUGIN=OFF \
-DWITH_MYSQL_PLUGIN=OFF \
-DWITH_XMLPATTERNS=OFF \
-DWITH_SCRIPT=OFF \
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE \
-DCMAKE_CXX_FLAGS=-Wno-register \
-S . -B out/build
else
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=out/install \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
-DWITH_MULTIMEDIA=OFF \
-DWITH_SQL=OFF \
-DWITH_WEBKIT=OFF \
-DWITH_PSQL_PLUGIN=OFF \
-DWITH_MYSQL_PLUGIN=OFF \
-DWITH_XMLPATTERNS=OFF \
-DWITH_SCRIPT=OFF \
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE \
-DCMAKE_CXX_FLAGS=-Wno-register \
-S . -B out/build
fi
cmake --build out/build -j `nproc`
cmake --install out/build
- name: Build
if: runner.os == 'Windows'
shell: cmd
env:
CC: cl
CXX: cl
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
set
where cmake && cmake --version
where ninja && ninja --version
where %CC% && %CC%
where %CXX% && %CXX%
if "${{ matrix.config.build-type }}" EQU "debug" (
cmake ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_INSTALL_PREFIX=out/install ^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ^
-DWITH_MULTIMEDIA=OFF ^
-DWITH_SQL=OFF ^
-DWITH_WEBKIT=OFF ^
-DWITH_PSQL_PLUGIN=OFF ^
-DWITH_MYSQL_PLUGIN=OFF ^
-DWITH_XMLPATTERNS=OFF ^
-DWITH_SCRIPT=OFF ^
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE ^
-S . -B out/build
) else (
cmake ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=RelWithDebInfo ^
-DCMAKE_INSTALL_PREFIX=out/install ^
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW ^
-DWITH_MULTIMEDIA=OFF ^
-DWITH_SQL=OFF ^
-DWITH_WEBKIT=OFF ^
-DWITH_PSQL_PLUGIN=OFF ^
-DWITH_MYSQL_PLUGIN=OFF ^
-DWITH_XMLPATTERNS=OFF ^
-DWITH_SCRIPT=OFF ^
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE ^
-S . -B out/build
)
cmake --build out/build -j %NUMBER_OF_PROCESSORS%
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --install out/build
- name: Build compressed artifacts
shell: bash
run: |
cd out
mv install ${{ env.ARTIFACT_NAME }}
tar czfp ${{ env.ARTIFACT_NAME }}.tgz ${{ env.ARTIFACT_NAME }}
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: out/${{ env.ARTIFACT_NAME }}.tgz
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/Davenche'
steps:
- name: Get top commit details
uses: actions/[email protected]
id: author-date
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commit_details = await github.git.getCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: context.sha });
return commit_details.data.author.date
- name: Setup environment
run: |
export COMMITTED_AT=$(date -d ${{ steps.author-date.outputs.result }} +'%Y.%m.%d_%H.%M.%S')
echo "COMMITTED_AT=$COMMITTED_AT" >> $GITHUB_ENV
echo "ARTIFACT_JAMMY_GCC_DEBUG=${{ env.MODULE_NAME }}_jammy-gcc_debug" >> $GITHUB_ENV
echo "ARTIFACT_JAMMY_GCC_RELEASE=${{ env.MODULE_NAME }}_jammy-gcc_release" >> $GITHUB_ENV
echo "ARTIFACT_WINDOWS_CL_DEBUG=${{ env.MODULE_NAME }}_windows-cl_debug" >> $GITHUB_ENV
echo "ARTIFACT_WINDOWS_CL_RELEASE=${{ env.MODULE_NAME }}_windows-cl_release" >> $GITHUB_ENV
- name: Download artifacts (jammy-gcc_debug)
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}
- name: Download artifact (jammy-gcc_release)
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}
- name: Download artifact (windows-cl_debug)
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}
- name: Download artifact (windows-cl_release)
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}
- name: List directory contents
run: ls -R
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.COMMITTED_AT }}
release_name: ${{ env.MODULE_NAME }}
draft: false
prerelease: false
- name: Upload Release Asset (jammy-gcc_debug)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_JAMMY_GCC_DEBUG }}.tgz
asset_name: 'jammy-gcc_debug.tgz'
asset_content_type: application/zip
- name: Upload Release Asset (jammy-gcc_release)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_JAMMY_GCC_RELEASE }}.tgz
asset_name: 'jammy-gcc_release.tgz'
asset_content_type: application/zip
- name: Upload Release Asset (windows-cl_debug)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_WINDOWS_CL_DEBUG }}.tgz
asset_name: 'windows-cl_debug.tgz'
asset_content_type: application/zip
- name: Upload Release Asset (windows-cl_release)
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_WINDOWS_CL_RELEASE }}.tgz
asset_name: 'windows-cl_release.tgz'
asset_content_type: application/zip
- name: Delete some old releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}