-
Notifications
You must be signed in to change notification settings - Fork 2
822 lines (805 loc) · 29.3 KB
/
Copy pathbuild.yml
File metadata and controls
822 lines (805 loc) · 29.3 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
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
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
name: brgen-build
run-name: Build
on:
push:
workflow_dispatch:
concurrency:
group: build-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-rebrgen-native:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Set up Clang
uses: egor-tensin/setup-clang@23bc15cd4207e45f1566447deb48f4ff3ef932cb # v2.3
with:
version: latest
platform: x64
- name: Install libc++-dev and libc++abi-dev
run: sudo apt-get install libc++-dev libc++abi-dev -y
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: rebrgen-native-${{ runner.os }}
- name: Cache rebrgen native
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_rebrgen_native
env:
cache-name: cache-rebrgen-native-built
with:
path: |
./rebrgen/built
./rebrgen/utils
key: rebrgen-native-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('rebrgen/script/build.py') }}
- name: Pull Utils
if: ${{ steps.cache_rebrgen_native.outputs.cache-hit }}
working-directory: rebrgen
run: |
cd utils
git pull
. build shared Release futils
cd ..
- name: Clone Utils
if: ${{ !(steps.cache_rebrgen_native.outputs.cache-hit) }}
working-directory: rebrgen
run: |
git clone https://github.com/on-keyday/utils.git
cd utils
. build shared Release futils
cd ..
- name: Build Native
working-directory: rebrgen
run: |
USE_CCACHE=1 BUILD_OLD_BMGEN=1 FUTILS_DIR=$(pwd)/utils python script/build.py native Release
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rebrgen-native-tool
path: rebrgen/tool
build-rebrgen-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Emscripten
id: setup-emsdk
uses: ./.github/actions/setup-emsdk
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Set up Clang
uses: egor-tensin/setup-clang@23bc15cd4207e45f1566447deb48f4ff3ef932cb # v2.3
with:
version: latest
platform: x64
- name: Install libc++-dev and libc++abi-dev
run: sudo apt-get install libc++-dev libc++abi-dev -y
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: rebrgen-wasm-${{ runner.os }}
- name: Cache rebrgen wasm
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_rebrgen_wasm
env:
cache-name: cache-rebrgen-wasm-built
with:
path: |
./rebrgen/built
./rebrgen/utils
key: rebrgen-wasm-${{ runner.os }}-${{ env.cache-name }}-${{ steps.setup-emsdk.outputs.version }}-${{ hashFiles('rebrgen/script/build.py') }}
- name: Pull Utils
if: ${{ steps.cache_rebrgen_wasm.outputs.cache-hit }}
working-directory: rebrgen
run: |
cd utils
git pull
rm -rf ./built
. build wasm-em Release futils
cd ..
- name: Clone Utils
if: ${{ !(steps.cache_rebrgen_wasm.outputs.cache-hit) }}
working-directory: rebrgen
run: |
git clone https://github.com/on-keyday/utils.git
cd utils
rm -rf ./built
. build wasm-em Release futils
cd ..
- name: Build WASM
working-directory: rebrgen
run: |
USE_CCACHE=1 BUILD_OLD_BMGEN=1 EMSDK_DIR=$EMSDK/ FUTILS_DIR=./utils python script/build.py web Release
cp README.md web/ || true
cp LICENSE web/ || true
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: rebrgen-wasm-web
path: rebrgen/web
build-rebrgen-glue:
needs: [build-rebrgen-native, build-rebrgen-wasm]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Download native tool
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rebrgen-native-tool
path: rebrgen/tool
- name: Download WASM web
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rebrgen-wasm-web
path: rebrgen/web
- name: Install libc++-dev and libc++abi-dev
run: sudo apt-get install libc++-dev libc++abi-dev -y
- name: Generate Glue
working-directory: rebrgen
run: |
chmod -R +x ./tool
python script/bm/generate_web_glue.py
python script/ebmwebgen.py
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bmgen-web
path: rebrgen/web
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
env: ["llvm", "gcc"]
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Set up Clang
uses: egor-tensin/setup-clang@23bc15cd4207e45f1566447deb48f4ff3ef932cb # v2.3
with:
version: latest
platform: x64
- name: Install libc++-dev and libc++abi-dev
run: sudo apt-get install libc++-dev libc++abi-dev -y
if: matrix.env == 'llvm'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-linux-${{ matrix.env }}
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# prevent renovate from updating this
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_linux
env:
cache-name: cache-linux-built-${{ matrix.env }}
with:
path: |
./built
./utils
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('build.py') }}-${{ matrix.env }}
- name: Pull Utils
if: ${{ steps.cache_linux.outputs.cache-hit }}
run: |
cd utils
git pull
# default is llvm
if [ "${{ matrix.env }}" = "gcc" ]; then
export FUTILS_CXX_COMPILER=g++
export FUTILS_C_COMPILER=gcc
fi
. build shared Release futils
cd ..
- name: Build
run: |
# default is llvm
if [ "${{ matrix.env }}" = "gcc" ]; then
export FUTILS_CXX_COMPILER=g++
export FUTILS_C_COMPILER=gcc
fi
USE_CCACHE=1 FUTILS_DIR=./utils python build.py native Release
./tool/src2json --version
- name: Pack artifacts
run: |
mkdir -p artifacts
cp -a ./tool ./artifacts/tool
cp -a ./script/link_path.sh ./artifacts
cp -a ./example ./artifacts/example
cp -a ./LICENSE ./artifacts
cp -a ./README.md ./artifacts
cp -a ./README.ja.md ./artifacts
cp -a ./brgen.json ./artifacts
cp -a ./script/make_cpp_test.sh ./artifacts
cp -a ./script/make_cpp_tests.sh ./artifacts
cp -a ./testkit ./artifacts/testkit
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-linux-${{ matrix.env }}
path: ./artifacts
build-macos:
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ">=1.20"
- name: Install Homebrew Clang
run: |
brew install llvm
- name: Check Code
run: |
PREFIX=$(brew --prefix llvm)
# from https://github.com/llvm/llvm-project/issues/77786
LIBCPP=$PREFIX/lib/c++
ls $LIBCPP
echo "libc++"
nm $LIBCPP/libc++.1.dylib | c++filt
echo "libc++abi"
nm $LIBCPP/libc++abi.1.dylib | c++filt
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-macos
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# prevent renovate from updating this
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_macos
env:
cache-name: cache-macos-built
with:
path: |
./built
./utils
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('build.py') }}
- name: Pull Utils
if: ${{ steps.cache_macos.outputs.cache-hit }}
run: |
cd utils
git pull
PREFIX=$(brew --prefix llvm)
export FUTILS_CXX_COMPILER=$PREFIX/bin/clang++
export FUTILS_C_COMPILER=$PREFIX/bin/clang
export LDFLAGS="-L$PREFIX/lib/c++ -L$PREFIX/lib/unwind -lunwind -Wl,-rpath,$PREFIX/lib/c++"
. build shared Release futils
cd ..
- name: Build
run: |
PREFIX=$(brew --prefix llvm)
export FUTILS_CXX_COMPILER=$PREFIX/bin/clang++
export FUTILS_C_COMPILER=$PREFIX/bin/clang
export LDFLAGS="-L$PREFIX/lib/c++ -L$PREFIX/lib/unwind -lunwind -Wl,-rpath,$PREFIX/lib/c++"
USE_CCACHE=1 FUTILS_DIR=./utils python build.py native Release
./tool/src2json --version
- name: Pack artifacts
run: |
mkdir -p artifacts
cp -a ./tool ./artifacts/tool
cp -a ./script/link_path.sh ./artifacts
cp -a ./example ./artifacts/example
cp -a ./LICENSE ./artifacts
cp -a ./README.md ./artifacts
cp -a ./README.ja.md ./artifacts
cp -a ./brgen.json ./artifacts
cp -a ./script/make_cpp_test.sh ./artifacts
cp -a ./script/make_cpp_tests.sh ./artifacts
cp -a ./testkit ./artifacts/testkit
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-macos
path: ./artifacts
build-windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Set up Clang
uses: egor-tensin/setup-clang@23bc15cd4207e45f1566447deb48f4ff3ef932cb # v2.3
with:
version: latest
platform: x64
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-windows
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache_windows
# prevent renovate from updating this
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
env:
cache-name: cache-windows-built
with:
path: |
./built
./utils
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('build.py') }}
- name: Pull Utils
if: ${{ steps.cache_windows.outputs.cache-hit }}
shell: cmd
run: |
cd utils
git pull
call build.bat shared Release futils
cd ..
- name: Build
shell: pwsh
run: |
$env:USE_CCACHE = "1"
$env:FUTILS_DIR = "$pwd\utils"
python build.py native Release
.\tool\src2json.exe --version
- name: Pack artifacts
shell: cmd
run: |
mkdir artifacts
xcopy /E /I /Y tool artifacts\tool
xcopy /E /I /Y example artifacts\example
copy /Y LICENSE artifacts
copy /Y README.md artifacts
copy /Y README.ja.md artifacts
copy /Y brgen.json artifacts
copy /Y script\make_cpp_test.bat artifacts
copy /Y script\make_cpp_tests.bat artifacts
xcopy /E /I /Y testkit artifacts\testkit
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-windows
path: ./artifacts
build-vscode-extension:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- name: Setup ast2ts
run: |
cd astlib/ast2ts
npm install
tsc
cd ../..
- name: Install VSCE
run: npm install -g vsce
- name: Build
run: |
cd lsp
npm install
vsce package
- name: Pack artifacts
run: |
mkdir -p artifacts
cp -a ./lsp/LICENSE ./artifacts
cp -a ./lsp/brgen-lsp-*.vsix ./artifacts
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-vscode-extension
path: ./artifacts
build-arm-linux:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Install Cross Compiler
run: |
sudo apt-get update && sudo apt-get install -y g++-aarch64-linux-gnu
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-arm-linux
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_arm_linux
env:
cache-name: cache-arm-linux-built
with:
path: |
./built
./utils
key: ${{ runner.os }}-arm-${{ env.cache-name }}-${{ hashFiles('build.py') }}
- name: Pull Utils
if: ${{ steps.cache_arm_linux.outputs.cache-hit }}
run: |
cd utils
git pull
export FUTILS_CXX_COMPILER=aarch64-linux-gnu-g++
export FUTILS_C_COMPILER=aarch64-linux-gnu-gcc
. build shared Release futils
cd ..
- name: Build
run: |
go version
export GOARCH=arm64
export FUTILS_CXX_COMPILER=aarch64-linux-gnu-g++
export FUTILS_C_COMPILER=aarch64-linux-gnu-gcc
export CC=$FUTILS_C_COMPILER
USE_CCACHE=1 FUTILS_DIR=./utils python build.py native Release
- name: Pack artifacts
run: |
mkdir -p artifacts
cp -a ./tool ./artifacts/tool
cp -a ./script/link_path.sh ./artifacts
cp -a ./example ./artifacts/example
cp -a ./LICENSE ./artifacts
cp -a ./README.md ./artifacts
cp -a ./README.ja.md ./artifacts
cp -a ./brgen.json ./artifacts
cp -a ./script/make_cpp_test.sh ./artifacts
cp -a ./script/make_cpp_tests.sh ./artifacts
cp -a ./testkit ./artifacts/testkit
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-linux-arm
path: ./artifacts
build-android:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- name: Install Android NDK
uses: nttld/setup-ndk@ed92fe6cadad69be94a966a7ee3271275e62f779 # v1.6.0
with:
ndk-version: r26b
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-android
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_android
env:
cache-name: cache-android-built
with:
path: |
./built
./utils
key: ${{ runner.os }}-android-${{ env.cache-name }}-${{ hashFiles('build.py') }}
- name: Pull Utils
if: ${{ steps.cache_android.outputs.cache-hit }}
run: |
BASE_PATH=/opt/hostedtoolcache/ndk/r26b/x64/toolchains/llvm/prebuilt/linux-x86_64
cd utils
git pull
export FUTILS_CXX_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang++
export FUTILS_C_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang
. build shared Release futils
cd ..
- name: Build
run: |
BASE_PATH=/opt/hostedtoolcache/ndk/r26b/x64/toolchains/llvm/prebuilt/linux-x86_64
#ls -Ral $BASE_PATH
export GOARCH=arm64
export FUTILS_CXX_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang++
export FUTILS_C_COMPILER=$BASE_PATH/bin/aarch64-linux-android21-clang
export CC=$FUTILS_C_COMPILER
USE_CCACHE=1 FUTILS_DIR=./utils python build.py native Release
LIBCPP_SHARED=$BASE_PATH/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so
cp $LIBCPP_SHARED ./tool
- name: Pack artifacts
run: |
mkdir -p artifacts
cp -a ./tool ./artifacts/tool
cp -a ./script/link_path.sh ./artifacts
cp -a ./example ./artifacts/example
cp -a ./LICENSE ./artifacts
cp -a ./README.md ./artifacts
cp -a ./README.ja.md ./artifacts
cp -a ./brgen.json ./artifacts
cp -a ./script/make_cpp_test.sh ./artifacts
cp -a ./script/make_cpp_tests.sh ./artifacts
cp -a ./testkit ./artifacts/testkit
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-android
path: ./artifacts
collect-licenses:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: fetch dependencies
run: |
go mod download
cd astlib/ast2ts
npm install
tsc
cp ../../LICENSE ./out
cd ../../lsp
npm install
cd server
npm install
cd ../client
npm install
cd ../../src/tool/json2rust
mkdir -p ./pkg
cp ../../../LICENSE ./pkg
cd ../../../web/doc
go mod download
cd ../dev
npm install
cd ../..
- name: Install gocredits
run: |
go install github.com/Songmu/gocredits/cmd/gocredits@latest
- name: Set up ruby
uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0
with:
ruby-version: ruby
- uses: github/setup-licensed@be11bcbb82e3140b6cf260e647c3efeeca8fcefd # v1.3.1
with:
version: "4.4" # required: supports matching based on string equivalence or node-semver range
- name: Collect licenses
run: |
go mod edit -json
. ./script/collect_licenses.sh
- name: List licenses
run: |
ls -alR ./license_cache
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-licenses
path: ./license_cache
build-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
env: ["development", "production"]
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Emscripten
id: setup-emsdk
uses: ./.github/actions/setup-emsdk
- name: Set up Ninja
uses: seanmiddleditch/gha-setup-ninja@7e868db0f3406270dd46e1dac26c65f621456723 # master
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: "1.26"
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
key: brgen-wasm-${{ matrix.env }}
- name: Cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
if: (!startsWith(github.ref , 'refs/heads/renovate/')) && (!startsWith(github.ref , 'refs/heads/dependabot/'))
id: cache_wasm
env:
cache-name: cache-wasm-built-${{ matrix.env }}
with:
path: |
./built
./utils
key: ${{ runner.os }}-${{ env.cache-name }}-${{ steps.setup-emsdk.outputs.version }}-${{ hashFiles('build.py') }}
- name: Pull Utils
if: ${{ steps.cache_wasm.outputs.cache-hit }}
run: |
. $EMSDK/emsdk_env.sh
cd utils
git pull
rm -rf built
if [ "${{ matrix.env }}" = "production" ]; then
MODE=Release
else
MODE=Debug
fi
. build wasm-em $MODE futils
cd ..
- name: Set up wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build Wasm
run: |
export WEB_PRODUCTION=${{ matrix.env }}
rm -rf built
if [ "${{ matrix.env }}" = "production" ]; then
MODE=Release
else
MODE=Debug
fi
USE_CCACHE=1 EMSDK_DIR=$EMSDK/ FUTILS_DIR=./utils python build.py wasm $MODE
- name: Upload WASM lib
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-wasm-lib-${{ matrix.env }}
path: |
./web/dev/src/lib
./src/tool/json2rust/pkg
build-pages:
needs: [unictest, build-wasm, build-rebrgen-glue]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
env: ["development", "production"]
steps:
- name: Timeline
uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
node-version: "23.11"
- name: Set up ast2ts
run: |
cd astlib/ast2ts
npm install
tsc
cd ../..
- name: Download brgen WASM lib
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: brgen-wasm-lib-${{ matrix.env }}
path: .
- name: Download rebrgen WASM artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bmgen-web
path: "./rebrgen-web"
- name: Install rebrgen artifacts
run: |
chmod +x ./script/install_rebrgen_web.sh
./script/install_rebrgen_web.sh ./rebrgen-web
- name: Build npm
run: |
export WEB_PRODUCTION=${{ matrix.env }}
python build.py npm
- name: Run API server tests
if: matrix.env == 'development'
run: |
cd web/dev
npm test
- name: Setup Hugo
uses: peaceiris/actions-hugo@2752ce1d29631191ea3f27c23495fa06139a5b78 # v3.2.1
with:
hugo-version: "latest"
extended: true
- name: Build Hugo
run: |
cd web/doc
hugo --minify
cd ../..
- name: Download unictest results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: unictest-results
path: "./unictest-results"
- name: Copy unictest results
run: |
cp -a ./unictest-results ./web/public/unictest-results
- name: Pack server kit
if: matrix.env == 'production'
run: |
chmod +x ./script/pack_server_kit.sh
./script/pack_server_kit.sh
cp script/api_server.sh web/public/
chmod +x web/public/api_server.sh
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: brgen-web-${{ matrix.env }}
path: "./web/public"
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
if: matrix.env == 'production'
run-test:
needs: build-linux
uses: ./.github/workflows/brgen-test.yaml
puppeteer-test:
needs: build-pages
uses: ./.github/workflows/puppeteer-test.yml
release:
needs:
[
build-linux,
build-macos,
build-windows,
build-vscode-extension,
build-arm-linux,
build-android,
build-pages,
collect-licenses,
run-test,
puppeteer-test,
]
uses: ./.github/workflows/release.yml
permissions:
contents: write
id-token: write
attestations: write
deploy:
needs: puppeteer-test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/deploy.yml
permissions:
contents: read
pages: write
id-token: write
unictest:
needs: [build-linux, build-rebrgen-native]
uses: ./.github/workflows/unictest.yaml