-
Notifications
You must be signed in to change notification settings - Fork 17
705 lines (631 loc) · 26.5 KB
/
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
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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
name: Continuous Integration
on:
push:
branches:
- develop
- master
- '*'
tags:
- "v*.*.*"
pull_request:
branches:
- develop
concurrency:
group: ${{format('{0}:{1}', github.repository, github.ref)}}
cancel-in-progress: true
jobs:
cpp-matrix:
runs-on: ubuntu-latest
name: Generate Test Matrix
outputs:
matrix: ${{ steps.cpp-matrix.outputs.matrix }}
llvm-matrix: ${{ steps.llvm-matrix.outputs.llvm-matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Test Matrix
uses: alandefreitas/cpp-actions/[email protected]
id: cpp-matrix
with:
compilers: |
gcc 14
clang 18
msvc >=14.40
standards: '20'
latest-factors: ''
factors: |
msvc Optimized-Debug
build-types: |
gcc: Release
clang: Release
msvc: RelWithDebInfo
msvc Optimized-Debug: Debug
ccflags: |
msvc Optimized-Debug: /Ob1 /O2 /Zi
cxxflags: |
msvc Optimized-Debug: /Ob1 /O2 /Zi
install: |
gcc: git build-essential pkg-config python3 curl openjdk-11-jdk ninja-build pkg-config libncurses-dev libxml2-utils libxml2-dev
clang: git build-essential pkg-config python3 curl openjdk-11-jdk ninja-build pkg-config libncurses-dev libxml2-utils libxml2-dev
msvc: ''
extra-values: |
llvm-hash: e1065370aaacb1b1cb48e77d37d376bf024f4a39
llvm-id: {{ substr llvm-hash 0 7 }}
llvm-build-preset-prefix: {{#if optimized-debug}}debwithopt{{else}}{{lowercase build-type}}{{/if}}
llvm-build-preset-suffix: {{#if (ieq os 'windows') }}win{{else}}unix{{/if}}
llvm-build-preset: {{ llvm-build-preset-prefix }}-{{ llvm-build-preset-suffix }}
llvm-compiler-key: {{ compiler }}-{{ version }}
llvm-cache-key: llvm-libcxx-{{ lowercase os }}-{{ llvm-compiler-key }}-{{ llvm-build-preset-prefix }}-{{ llvm-hash }}
llvm-root: ../third-party/llvm-project/install
llvm-archive-basename: llvm-{{ os }}-{{ llvm-build-preset-prefix }}-{{ llvm-id }}
llvm-archive-extension: {{#if (ieq os 'windows') }}7z{{else}}tar.bz2{{/if}}
llvm-archive-filename: {{ llvm-archive-basename }}.{{ llvm-archive-extension }}
libcxx-runtimes: libcxx;libcxxabi{{#if (ine os 'windows') }};libunwind{{/if}}
libcxx-targets: cxx {{#if (ine os 'windows') }}cxxabi unwind{{/if}} install-cxx {{#if (ine os 'windows') }}install-cxxabi install-unwind{{/if}}
mrdocs-ccflags: {{ ccflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan{{/if}}
mrdocs-cxxflags: {{ cxxflags }} {{#if (eq compiler 'gcc') }}-static{{/if}} {{#if asan }}-static-libasan{{/if}} {{#if tsan }}-static-libtsan{{/if}}
mrdocs-package-generators: {{#if (ieq os 'windows') }}7Z ZIP WIX{{else}}TGZ TXZ{{/if}}
output-file: matrix.json
- name: Generate LLVM Test Matrix
id: llvm-matrix
run: |
set -x
npm install @actions/core
node .github/llvm-matrix.js
build:
needs: cpp-matrix
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.cpp-matrix.outputs.matrix) }}
defaults:
run:
shell: bash
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
env: ${{ matrix.env }}
permissions:
contents: write
steps:
- name: Clone MrDocs
uses: actions/checkout@v4
- name: Setup CMake
uses: alandefreitas/cpp-actions/[email protected]
id: setup-cmake
with:
version: '>=3.26'
check-latest: 'true'
update-environment: 'true'
trace-commands: 'true'
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@v4
if: ${{ runner.os == 'Windows' }}
- name: Setup C++
uses: alandefreitas/cpp-actions/[email protected]
id: setup-cpp
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
- name: Install System Packages
uses: alandefreitas/cpp-actions/[email protected]
if: matrix.compiler != 'msvc'
id: package-install
env:
DEBIAN_FRONTEND: 'noninteractive'
TZ: 'Etc/UTC'
with:
apt-get: ${{ matrix.install }}
- name: Install Duktape
uses: alandefreitas/cpp-actions/[email protected]
with:
source-dir: ../third-party/duktape
url: https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz
patches: |
./third-party/duktape/CMakeLists.txt
./third-party/duktape/duktapeConfig.cmake.in
build-dir: ${sourceDir}/build
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
ccflags: ${{ matrix.ccflags }}
cxxflags: ${{ matrix.cxxflags }}
build-type: ${{ matrix.build-type }}
shared: false
install: true
install-prefix: ${sourceDir}/install
run-tests: false
trace-commands: true
- name: Install Fmt
uses: alandefreitas/cpp-actions/[email protected]
with:
source-dir: ../third-party/fmt
git-repository: https://github.com/fmtlib/fmt
git-tag: 10.2.1
build-dir: ${sourceDir}/build
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
ccflags: ${{ matrix.ccflags }}
cxxflags: ${{ matrix.cxxflags }}
build-type: ${{ matrix.build-type }}
extra-args: |
-D FMT_DOC=OFF
-D FMT_TEST=OFF
install: true
install-prefix: ${sourceDir}/install
run-tests: false
trace-commands: true
- name: Install Libxml2
uses: alandefreitas/cpp-actions/[email protected]
if: matrix.compiler == 'msvc'
with:
source-dir: ../third-party/libxml2
git-repository: https://github.com/GNOME/libxml2
git-tag: v2.12.6
build-dir: ${sourceDir}/build
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
ccflags: ${{ matrix.ccflags }}
cxxflags: ${{ matrix.cxxflags }}
build-type: Release
extra-args: |
-D LIBXML2_WITH_PROGRAMS=ON
-D LIBXML2_WITH_FTP=OFF
-D LIBXML2_WITH_HTTP=OFF
-D LIBXML2_WITH_ICONV=OFF
-D LIBXML2_WITH_LEGACY=OFF
-D LIBXML2_WITH_LZMA=OFF
-D LIBXML2_WITH_ZLIB=OFF
-D LIBXML2_WITH_ICU=OFF
-D LIBXML2_WITH_TESTS=OFF
-D LIBXML2_WITH_HTML=ON
-D LIBXML2_WITH_C14N=ON
-D LIBXML2_WITH_CATALOG=ON
-D LIBXML2_WITH_DEBUG=ON
-D LIBXML2_WITH_ISO8859X=ON
-D LIBXML2_WITH_MEM_DEBUG=OFF
-D LIBXML2_WITH_MODULES=ON
-D LIBXML2_WITH_OUTPUT=ON
-D LIBXML2_WITH_PATTERN=ON
-D LIBXML2_WITH_PUSH=ON
-D LIBXML2_WITH_PYTHON=OFF
-D LIBXML2_WITH_READER=ON
-D LIBXML2_WITH_REGEXPS=ON
-D LIBXML2_WITH_SAX1=ON
-D LIBXML2_WITH_SCHEMAS=ON
-D LIBXML2_WITH_SCHEMATRON=ON
-D LIBXML2_WITH_THREADS=ON
-D LIBXML2_WITH_THREAD_ALLOC=OFF
-D LIBXML2_WITH_TREE=ON
-D LIBXML2_WITH_VALID=ON
-D LIBXML2_WITH_WRITER=ON
-D LIBXML2_WITH_XINCLUDE=ON
-D LIBXML2_WITH_XPATH=ON
-D LIBXML2_WITH_XPTR=ON
install: true
install-prefix: ${sourceDir}/install
run-tests: false
trace-commands: true
- name: Cached LLVM Binaries
id: llvm-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/${{ matrix.llvm-root }}
key: ${{ matrix.llvm-cache-key }}
- name: Download LLVM Binaries
id: llvm-download
if: steps.llvm-cache.outputs.cache-hit != 'true'
uses: alandefreitas/cpp-actions/[email protected]
with:
name: mrdocs-llvm
url: https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}
install-prefix: ../third-party/llvm-project
update-environment: false
trace-commands: true
fail-on-error: false
- name: Install LLVM
uses: alandefreitas/cpp-actions/[email protected]
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
with:
cmake-version: '>=3.26'
source-dir: ../third-party/llvm-project/llvm
git-repository: https://github.com/llvm/llvm-project.git
git-tag: ${{ matrix.llvm-hash }}
download-dir: ../third-party/llvm-project
patches: |
./third-party/llvm/CMakePresets.json
./third-party/llvm/CMakeUserPresets.json
build-dir: ${sourceDir}/llvm/build
preset: ${{ matrix.llvm-build-preset }}
build-type: ${{ matrix.build-type }}
cc: ${{ steps.setup-cpp.outputs.cc }}
cxx: ${{ steps.setup-cpp.outputs.cxx }}
install: true
install-prefix: ${sourceDir}/../install
run-tests: false
trace-commands: true
- name: Install LibC++
uses: alandefreitas/cpp-actions/[email protected]
if: steps.llvm-cache.outputs.cache-hit != 'true' && steps.llvm-download.outputs.found != 'true'
with:
cmake-version: '>=3.26'
source-dir: ../third-party/llvm-project/runtimes
build-dir: ${sourceDir}/build-libcxx
build-target: ${{ matrix.libcxx-targets }}
cc: ../third-party/llvm-project/install/bin/clang
cxx: ../third-party/llvm-project/install/bin/clang++
cxxflags: ${{ runner.os == 'Windows' && '-D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__' || '' }}
generator: Ninja
extra-args: |
-D LLVM_ENABLE_RUNTIMES="${{ matrix.libcxx-runtimes }}"
${{ runner.os == 'Windows' && '-D LIBCXXABI_USE_LLVM_UNWINDER=OFF' || '' }}
${{ runner.os == 'Windows' && '-D LIBCXXABI_ENABLE_SHARED=OFF' || '' }}
${{ runner.os == 'Windows' && '-D LIBCXXABI_ENABLE_STATIC=ON' || '' }}
${{ runner.os == 'Windows' && '-D LIBCXX_ENABLE_SHARED=OFF' || '' }}
${{ runner.os == 'Windows' && '-D LIBCXX_NO_VCRUNTIME=ON' || '' }}
install: true
install-prefix: ${sourceDir}/../install
run-tests: false
trace-commands: true
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: CMake Workflow
uses: alandefreitas/cpp-actions/[email protected]
with:
cmake-version: '>=3.26'
cxxstd: ${{ matrix.cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
ccflags: ${{ matrix.mrdocs-ccflags }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }}
cxxflags: ${{ matrix.mrdocs-cxxflags }}
generator: Ninja
toolchain: ${{ steps.package-install.outputs.vcpkg_toolchain || steps.package-install.outputs.vcpkg-toolchain }}
build-type: ${{ matrix.build-type }}
install-prefix: .local
extra-args: |
-D MRDOCS_BUILD_DOCS=OFF
-D LLVM_ROOT=../third-party/llvm-project/install
-D Clang_ROOT=../third-party/llvm-project/install
-D duktape_ROOT=../third-party/duktape/install
-D Duktape_ROOT=../third-party/duktape/install
-D fmt_ROOT=../third-party/fmt/install
${{ runner.os == 'Windows' && '-D libxml2_ROOT=../third-party/libxml2/install' || '' }}
${{ runner.os == 'Windows' && '-D LibXml2_ROOT=../third-party/libxml2/install' || '' }}
export-compile-commands: true
run-tests: true
install: true
package: ${{ matrix.is-main }}
package-dir: packages
package-generators: ${{ matrix.mrdocs-package-generators }}
package-artifact: false
- name: Upload GitHub Release Artifacts
if: ${{ matrix.is-main && matrix.compiler != 'clang' }}
uses: actions/upload-artifact@v4
with:
name: release-packages-${{ runner.os }}
path: build/packages
retention-days: 1
- name: FlameGraph
uses: alandefreitas/cpp-actions/[email protected]
if: matrix.time-trace
with:
build-dir: build
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Codecov
if: ${{ matrix.coverage }}
uses: codecov/[email protected]
with:
directory: './build'
fail_ci_if_error: true
gcov: true
verbose: true
releases:
needs: build
defaults:
run:
shell: bash
name: MrDocs Releases
timeout-minutes: 30
runs-on: ubuntu-latest
container: ubuntu:20.04
permissions:
contents: write
steps:
- name: Install packages
uses: alandefreitas/cpp-actions/[email protected]
id: package-install
with:
apt-get: build-essential asciidoctor cmake bzip2 git
- name: Clone mrdocs
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Download MrDocs package
uses: actions/download-artifact@v4
with:
name: release-packages-Linux
path: packages
- uses: actions/download-artifact@v4
with:
name: release-packages-Windows
path: packages
- name: Install MrDocs from Linux Package
run: |
set -x
find packages -name 'MrDocs-*-Linux.tar.gz' -exec tar -vxzf {} -C /usr/local --strip-components=1 \;
mrdocs --version
MRDOCS_ROOT=/usr/local
echo -e "MRDOCS_ROOT=$MRDOCS_ROOT" >> $GITHUB_ENV
- name: Clone Boost.URL
uses: alandefreitas/cpp-actions/[email protected]
id: boost-url-clone
with:
branch: develop
modules: url
boost-dir: boost
modules-scan-paths: '"test example"'
modules-exclude-paths: ''
trace-commands: true
- name: Generate Landing Page
working-directory: docs/website
run: |
npm ci
node render.js
mkdir -p ../../build/website
cp index.html ../../build/website/index.html
cp styles.css ../../build/website/styles.css
- name: Generate Remote Documentation
working-directory: docs
run: |
# This playbook renders the documentation
# content for the website. It includes
# master, develop, and tags.
npm ci
npx antora antora-playbook.yml
mkdir -p ../build/website/docs
cp -r build/site/* ../build/website/docs
- name: Upload Website as Artifact
uses: actions/upload-artifact@v4
with:
name: website
path: build/website
retention-days: 30
- name: Generate Local Documentation
working-directory: docs
run: |
# This playbook allows us to render the
# documentation content and visualize it
# before a workflow that pushes to the
# website is triggered.
npx antora antora-playbook.yml --attribute branchesarray=HEAD
mkdir -p ../build/docs-local
cp -r build/site/* ../build/docs-local
- name: Generate Demos
run: |
declare -a generators=(
"adoc"
"xml"
)
# Generate the demos for each variant and generator
for variant in single multi; do
for generator in "${generators[@]}"; do
[[ $generator = xml && $variant = multi ]] && continue
[[ $variant = multi ]] && multipage="true" || multipage="false"
mrdocs --config="$(pwd)/boost/libs/url/doc/mrdocs.yml" "../CMakeLists.txt" --output="$(pwd)/demos/boost-url/$variant/$generator" --multipage=$multipage --generate="$generator"
echo "Number of files in demos/boost-url/$variant/$format: $(find demos/boost-url/$variant/$format -type f | wc -l)"
done
done
# Compress demos for the artifact
tar -cjf $(pwd)/demos.tar.gz -C $(pwd)/demos --strip-components 1 .
echo "demos_path=$(pwd)/demos.tar.gz" >> $GITHUB_ENV
- name: Upload Demos as Artifacts
uses: actions/upload-artifact@v4
with:
name: demos${{ (contains(fromJSON('["master", "develop"]'), github.ref_name ) && format('-{0}', github.ref_name)) || '' }}
path: ${{ env.demos_path }}
# develop and master are retained for longer so that they can be compared
retention-days: ${{ contains(fromJSON('["master", "develop"]'), github.ref_name) && '30' || '1' }}
- name: Download Previous Demos
if: startsWith(github.ref, 'refs/tags/')
id: download-prev-demos
uses: actions/download-artifact@v4
with:
name: demos-develop
path: demos-previous
- name: Compare demos
if: startsWith(github.ref, 'refs/tags/') && steps.download-prev-demos.outputs.cache-hit == 'true'
id: compare-demos
run: |
set -x
# Define URLs and directories
LOCAL_DEMOS_DIR="./demos/"
PREV_DEMOS_DIR="./demos-previous/"
DIFF_DIR="./demos-diff/"
# Create directories if they don't exist
mkdir -p $PREV_DEMOS_DIR $DIFF_DIR
# Iterate over the previous files and compare them with the corresponding local files
find $PREV_DEMOS_DIR -type f | while read previous_file; do
# Derive the corresponding local file path
local_file="${LOCAL_DEMOS_DIR}${previous_file#$PREV_DEMOS_DIR}"
diff_output="$DIFF_DIR${previous_file#$PREV_DEMOS_DIR}"
if [[ -f $local_file ]]; then
mkdir -p "$(dirname "$diff_output")"
diff "$previous_file" "$local_file" > "$diff_output"
if [[ ! -s $diff_output ]]; then
rm "$diff_output"
fi
else
echo "LOCAL FILE $local_file DOES NOT EXITS." > "$diff_output"
echo "PREVIOUS CONTENT OF THE FILE WAS:" >> "$diff_output"
cat "$previous_file" >> "$diff_output"
fi
done
# Iterate over the local files to find new files
find $LOCAL_DEMOS_DIR -type f | while read local_file; do
previous_file="${PREV_DEMOS_DIR}${local_file#$LOCAL_DEMOS_DIR}"
diff_output="$DIFF_DIR${local_file#$LOCAL_DEMOS_DIR}"
if [[ ! -f $previous_file ]]; then
echo "PREVIOUS $previous_file DOES NOT EXIST." > "$diff_output"
echo "IT HAS BEEN INCLUDED IN THIS VERSION." >> "$diff_output"
echo "NEW CONTENT OF THE FILE IS:" >> "$diff_output"
fi
done
# Check if the diff directory is empty
if [[ -z $(ls -A $DIFF_DIR) ]]; then
echo "No differences found."
# Store this as an output for the next step
echo "diff=false" >> $GITHUB_OUTPUT
else
# Calculate number of files in the diff directory
N_FILES=$(find $DIFF_DIR -type f | wc -l)
echo "Differences found in $N_FILES output files."
echo "diff=true" >> $GITHUB_OUTPUT
fi
- name: Upload Demo Diff as Artifacts
if: startsWith(github.ref, 'refs/tags/') && steps.download-prev-demos.outputs.cache-hit == 'true' && steps.compare-demos.outputs.diff == 'true'
uses: actions/upload-artifact@v4
with:
name: demos-diff
path: demos-diff
retention-days: 30
- name: Publish Website to GitHub Pages
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/website
force_orphan: true
- name: Publish website
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
# Add SSH key
mkdir -p /home/runner/.ssh
ssh-keyscan dev-websites.cpp.al >> /home/runner/.ssh/known_hosts
chmod 600 /home/runner/.ssh/known_hosts
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/github_actions
# Copy files: This step will copy the landing page and the documentation to www.mrdocs.com
chmod 755 -R $(pwd)/build/website
scp -o StrictHostKeyChecking=no -r $(pwd)/build/website/* [email protected]:/var/www/mrdox.com/
# Remove previous demos associated with this tag
demo_dir="/var/www/mrdox.com/demos/${{ github.ref_name }}"
ssh -o StrictHostKeyChecking=no [email protected] "rm -rf $demo_dir/boost-url; mkdir -p $demo_dir/boost-url"
# Copy demos: This step will copy the demos to www.mrdocs.com/demos
chmod 755 -R $(pwd)/demos
scp -o StrictHostKeyChecking=no -r $(pwd)/demos/* [email protected]:$demo_dir/
- name: Clone mrdocs
uses: actions/checkout@v4
- name: Set Repository Ownership
run: |
git config --global --add safe.directory "$(pwd)"
- name: Create changelog
uses: alandefreitas/cpp-actions/[email protected]
with:
output-path: CHANGELOG.md
thank-non-regular: ${{ startsWith(github.ref, 'refs/tags/') }}
github-token: ${{ secrets.GITHUB_TOKEN }}
limit: 150
- name: Check Info Nodes
run: |
set -x
chmod +x .github/check_info_nodes_support.sh
.github/check_info_nodes_support.sh
- name: Create GitHub Package Release
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }}
uses: softprops/action-gh-release@v1
with:
files: packages/MrDocs-?.?.?-*.*
name: ${{ github.ref_name || github.ref }}
tag_name: ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }}
body_path: CHANGELOG.md
prerelease: false
draft: false
token: ${{ github.token }}
- name: Delete Older Releases
uses: dev-drprasad/[email protected]
if: ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }}
with:
keep_latest: 1
delete_tag_pattern: ${{ github.ref_name || github.ref }}${{ ((!startsWith(github.ref, 'refs/tags/')) && '-release') || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
llvm-releases:
needs: [ build, cpp-matrix ]
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.cpp-matrix.outputs.llvm-matrix) }}
defaults:
run:
shell: bash
name: ${{ matrix.name }} LLVM Release
runs-on: ${{ matrix.runs-on }}
container: ${{ matrix.container }}
env: ${{ matrix.env }}
permissions:
contents: write
steps:
- name: Install packages
uses: alandefreitas/cpp-actions/[email protected]
id: package-install
with:
apt-get: build-essential asciidoctor cmake bzip2 git curl
- name: Check website releases
id: website-releases
run: |
set -x
archive_url="https://mrdocs.com/llvm+clang/${{ matrix.llvm-archive-filename }}"
http_status=$(curl -s -o /dev/null -w "%{http_code}" -I "$archive_url")
if [ "$http_status" -eq 200 ]; then
exists="true"
else
exists="false"
fi
echo "exists=$exists" >> $GITHUB_OUTPUT
- name: LLVM Binaries
id: llvm-cache
if: steps.website-releases.outputs.exists != 'true'
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/${{ matrix.llvm-root }}
key: ${{ matrix.llvm-cache-key }}
- name: Compress LLVM
id: llvm-upload
if: steps.llvm-cache.outputs.cache-hit == 'true'
shell: bash
run: |
# LLVM is be installed with the default compiler
set -x
# Compress the LLVM installation
cd ../third-party/llvm-project
# Use 7z on windows
if [[ ${{ runner.os }} == 'Windows' ]]; then
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on ${{ matrix.llvm-archive-filename }} install
else
tar -cjf ${{ matrix.llvm-archive-filename }} -C install .
fi
- name: Website LLVM Releases
if: steps.llvm-cache.outputs.cache-hit == 'true' && github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/'))
working-directory: ../third-party/llvm-project
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
# Add SSH key
mkdir -p /home/runner/.ssh
ssh-keyscan dev-websites.cpp.al >> /home/runner/.ssh/known_hosts
chmod 600 /home/runner/.ssh/known_hosts
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/github_actions
# Remove previous demos associated with this tag
llvm_dir="/var/www/mrdox.com/llvm+clang"
chmod 755 -R ${{ matrix.llvm-archive-filename }}
scp -o StrictHostKeyChecking=no $(pwd)/${{ matrix.llvm-archive-filename }} [email protected]:$llvm_dir/