-
Notifications
You must be signed in to change notification settings - Fork 77
407 lines (345 loc) · 13.5 KB
/
build-all.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
name: build-all
on:
workflow_dispatch:
push:
jobs:
common-steps:
runs-on: ubuntu-22.04
steps:
- name: install all the necessary packages
run: |
sudo apt update
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt -y install libreoffice ttf-mscorefonts-installer
- name: Checkout Oolite
uses: actions/checkout@v4
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Calculate version number and set OOLITE_VERSION
id: version
run: |
set -x
cd oolite
# Build version string,
# taking into account that we may have just two digits
VERSION=$(cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2)
VER_MAJ=$(echo ${VERSION} | cut -d. -f1)
VER_MIN=$(echo ${VERSION} | cut -d. -f2)
VER_REV=$(echo ${VERSION} | cut -d. -f3)
if [ "" == "${VER_REV}" ]
then
VER_REV="0"
fi
VER_DATE=$(date +%y%m%d)
VER_GITREV=$(git rev-list --count HEAD)
VER_GITHASH=$(git rev-parse --short=7 HEAD)
VER="${VER_MAJ}.${VER_MIN}.${VER_REV}.${VER_GITREV}-${VER_DATE}-${VER_GITHASH}"
echo "OOLITE_VERSION=${VER}" >> "$GITHUB_OUTPUT"
echo "OOLITE_VERSION=${VER}" >> Doc/OOLITE_VERSION.txt
- name: generate PDFs
run: |
find oolite/Doc -name "*.odt" -exec soffice --headless --convert-to pdf:"writer_pdf_Export" --outdir oolite/Doc {} \;
zip oolite-doc.zip oolite/Doc/*.pdf oolite/Doc/OOLITE_VERSION.txt
- name: Archive generated documentation
uses: actions/upload-artifact@v4
with:
name: oolite-doc
path: |
oolite-doc.zip
retention-days: 5
- name: Check Javascript with linter
run: |
npm install eslint
npm install --save-dev eslint eslint-plugin-es-x
npx eslint . || echo Ignore problems and continue
build-linux:
runs-on: ubuntu-22.04
needs: [common-steps]
strategy:
matrix:
flavour: [pkg-posix-nightly, pkg-posix-test, pkg-posix]
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# printenv | sort
- name: install all the necessary packages
run: |
sudo apt update
sudo apt -y install git gobjc gnustep-devel make libsdl1.2-dev libvorbis-dev libopenal-dev g++ libespeak-dev libnspr4-dev
- name: Checkout Oolite
uses: actions/checkout@v4
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: oolite-doc
path: artifacts
- name: Extract PDFs
run: |
unzip -u artifacts/oolite-doc.zip
# This is for debugging only and helps developing the workflow.
- name: show filesystem before build
run: |
find . -not -path "./oolite/deps/Windows-deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
- name: compiling up to installer script (.run file)
run: |
cd oolite
source /usr/share/GNUstep/Makefiles/GNUstep.sh
make -f Makefile ${{matrix.flavour}} HOST_ARCH=$(uname -m)
## This is for debugging only and helps developing the workflow.
# - name: show filesystem after build
# run: |
# find . -not -path "./oolite/Mac-specific/*" -not -path "./oolite/deps/Windows-deps/*" -not -path "./oolite/tests/*" -not -path "./oolite/.git/*" -not -path "./oolite/deps/mozilla/*"
# This is for debugging only and helps developing the workflow.
- name: show filesystem after installer
run: |
find . -not -path "./oolite/Mac-specific/*" -not -path "./oolite/deps/*" -not -path "./oolite/tests/*" -not -path "./oolite/.git/*"
- name: Archive installer
uses: actions/upload-artifact@v4
with:
name: ${{matrix.flavour}}
path: |
oolite/installers/posix/OoliteInstall-*.run
retention-days: 5
build-windows:
runs-on: windows-latest
needs: [common-steps]
strategy:
matrix:
flavour: [pkg-win-snapshot,pkg-win-deployment,pkg-win]
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# Get-ChildItem Env: | Sort Name
- name: Checkout DevelopmentEnvironment
uses: actions/checkout@v4
with:
repository: OoliteProject/oolite-windows-build-env
path: DevelopmentEnvironment
- name: Checkout Oolite
uses: actions/checkout@v4
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: oolite-doc
path: artifacts
- name: Extract PDFs
run: |
unzip -u artifacts/oolite-doc.zip
# check http://aegidian.org/bb/viewtopic.php?p=281821#p281821
# this is for debug only; it creates huge logs and takes a long time to execute, yet you never know when you need it
- name: check filesystem
run: |
Get-ChildItem -Path "$env:GITHUB_WORKSPACE" –Recurse
- name: Prepare compile script with flavour
shell: cmd
run: |
echo Want to build flavour ${{matrix.flavour}}
mkdir D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\etc\profile.d
echo export FLAVOUR="${{matrix.flavour}}" > D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\etc\profile.d\flavour.sh
cat D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\etc\profile.d\flavour.sh
- name: check filesystem after preparation
run: |
Get-ChildItem -Path "$env:GITHUB_WORKSPACE" –Recurse
- name: Compile
shell: cmd
run: |
D:\a\oolite\oolite\DevelopmentEnvironment\gcc\Msys_x2\1.0\msys.cmd
# check http://aegidian.org/bb/viewtopic.php?p=281821#p281821
# this is for debug only; it creates huge logs and takes a long time to execute, yet you never know when you need it
- name: check filesystem
run: |
Get-ChildItem -Path "$env:GITHUB_WORKSPACE" –Recurse
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: oolite-windows-${{matrix.flavour}}
path: |
oolite/installers/win32/OoliteInstall*.exe
retention-days: 5
build-doxygen:
runs-on: ubuntu-22.04
needs: [common-steps]
steps:
- name: install all the necessary packages
run: |
sudo apt update
sudo apt -y install graphviz
- name: Checkout Oolite
uses: actions/checkout@v4
with:
path: oolite
fetch-depth: 0
submodules: true
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: oolite-doc
path: artifacts
- name: Extract artifacts
run: |
unzip -u artifacts/oolite-doc.zip
- name: set version
id: version
run: |
OOLITE_VERSION=$(cat oolite/Doc/OOLITE_VERSION.txt | cut -d= -f2)
echo "OOLITE_VERSION=${OOLITE_VERSION}" >> "$GITHUB_OUTPUT"
sed -i -e "/PROJECT_NUMBER\s*=/ s/=.*/=${OOLITE_VERSION}/" oolite/Doxyfile
- name: Download latest Doxygen
id: download-doxygen
uses: robinraju/[email protected]
with:
repository: "doxygen/doxygen"
# A flag to set the download target as latest release
# The default value is 'false'
latest: true
# The github tag. e.g: v1.0.1
# Download assets from a specific tag/version
# tag: "v1.0.68"
# The release id to download files from
# releaseId: ""
# The name of the file to download.
# Use this field only to specify filenames other than tarball or
# zipball, if any.
# Supports wildcard pattern (eg: '*', '*.deb', '*.zip' etc..)
fileName: "doxygen-*.linux.bin.tar.gz"
# Download the attached tarball (*.tar.gz)
tarBall: false
# Download the attached zipball (*.zip)
zipBall: false
# Relative path under $GITHUB_WORKSPACE to place the downloaded
# file(s). It will create the target directory automatically if
# not present eg:
# out-file-path: "my-downloads"
# => It will create directory $GITHUB_WORKSPACE/my-downloads
out-file-path: "doxygen"
# A flag to set if the downloaded assets are archives and should
# be extracted. Checks all downloaded files if they end with zip,
# tar or tar.gz and extracts them, if true. Prints a warning if
# enabled but file is not an archive - but does not fail.
extract: true
- name: Check filesytem before Doxygen run
run: |
find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
#- name: Run doxygen
# uses: mattnotmitt/[email protected]
# with:
# working-directory: oolite
- name: Run Doxygen
run: |
echo Downloaded: ${{ fromJson(steps.download-doxygen.outputs.downloaded_files)[0] }}
cd oolite
../doxygen/doxygen-*/bin/doxygen
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables 1
# run: |
# printenv | sort
# find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
- name: create tar ball
run: |
tar cvfz oolite-apidoc-${{ steps.version.outputs.OOLITE_VERSION }}.tgz -C oolite doxygen
# This is for debugging only and helps developing the workflow.
- name: Environment Variables 2
run: |
find . -not -path "./oolite/deps/*" -not -path "./oolite/Mac-specific/*" -not -path "./oolite/.git/*"
- name: Archive build tar ball
uses: actions/upload-artifact@v4
with:
name: oolite-documentation-nightly
path: |
oolite-*.tgz
retention-days: 5
- name: Upload github pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: oolite/doxygen/html
release:
needs: [build-linux, build-windows, build-doxygen]
runs-on: ubuntu-22.04
steps:
## This is for debugging only and helps developing the workflow.
# - name: Environment Variables
# run: |
# printenv | sort
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
# This is for debugging only and helps developing the workflow.
- name: show filesystem after download
run: |
find . -type f | sort
echo
find . -type f -exec basename {} \; | sort
- name: Extract artifacts
run: |
ls -l artifacts
unzip -u artifacts/oolite-doc/oolite-doc.zip
- name: set version
id: version
run: |
OOLITE_VERSION=$(cat oolite/Doc/OOLITE_VERSION.txt | cut -d= -f2)
echo "OOLITE_VERSION=${OOLITE_VERSION}" >> "$GITHUB_OUTPUT"
- name: Remove old prereleases
if: github.ref == 'refs/heads/master'
uses: s00d/[email protected]
with:
keep_latest: 7
delete_type: 'prerelease'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# For changes on master branch, create a new release.
# It should move the 'latest' tag automatically.
- name: Create Release
if: github.ref == 'refs/heads/master'
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
# automatic_release_tag: "latest"
automatic_release_tag: "${{ steps.version.outputs.OOLITE_VERSION }}"
prerelease: true
title: "Oolite ${{ steps.version.outputs.OOLITE_VERSION }}"
files: |
artifacts/oolite-documentation-nightly/oolite-apidoc-*.tgz
artifacts/oolite-windows-pkg-win-snapshot/OoliteInstall-*-dev.exe
artifacts/oolite-windows-pkg-win-deployment/OoliteInstall-*.exe
artifacts/oolite-windows-pkg-win/OoliteInstall-*.exe
artifacts/pkg-posix-nightly/*.run
artifacts/pkg-posix/*.run
artifacts/pkg-posix-test/*.run
- name: Remove old workflow runs
if: github.ref == 'refs/heads/master'
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 8
deploySite:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build-doxygen
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2