@@ -56,13 +56,11 @@ jobs:
56
56
uses : actions/checkout@v4
57
57
with :
58
58
fetch-depth : 0
59
-
60
59
- name : Perform rebase
61
60
run : |
62
61
git fetch origin main
63
62
git checkout main-dev
64
63
git rebase origin/main
65
-
66
64
- name : Push changes
67
65
uses : CasperWA/push-protected@v2
68
66
with :
@@ -350,12 +348,8 @@ jobs:
350
348
strategy :
351
349
fail-fast : false
352
350
matrix :
353
- arch :
354
- - x64
355
- - x86
356
- os :
357
- - macos-latest
358
- - ubuntu-22.04
351
+ arch : [x64, x86]
352
+ os : [macos-latest, ubuntu-22.04]
359
353
exclude :
360
354
- arch : x86
361
355
os : macos-latest
@@ -365,100 +359,104 @@ jobs:
365
359
env :
366
360
CC : gcc-12
367
361
CXX : g++-12
368
-
369
362
steps :
370
- - name : Checkout the latest code
363
+ - name : Checkout Repository
371
364
uses : actions/checkout@v4
372
365
with :
373
366
ref : " main"
374
- - run : git submodule update --init --recursive
375
-
376
- - name : Set up Node.js
367
+ - name : Update Git Submodules
368
+ run : git submodule update --init --recursive
369
+ - name : Set Up Node.js
377
370
uses : actions/setup-node@v4
378
371
with :
379
- node-version : 20
372
+ node-version : " 20 "
380
373
architecture : ${{ matrix.arch }}
381
-
382
- - name : Update compilers
374
+ - name : Update System Compilers (Ubuntu Only)
383
375
if : matrix.os == 'ubuntu-22.04'
384
376
run : |
377
+ echo "Updating compilers and installing build dependencies on Ubuntu"
385
378
sudo apt update
386
379
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
387
- sudo apt install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
388
-
389
- - run : npm ci --ignore-scripts
390
- - run : npm run prebuild-single
380
+ sudo apt install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
381
+ - name : Install Node.js Dependencies
382
+ run : npm ci --ignore-scripts
383
+ - name : Prebuild Native Modules (Linux / Non-Darwin)
391
384
if : matrix.os != 'macos-latest'
392
- - run : npm run prebuild-darwin-x64+arm64
385
+ run : npm run prebuild-single
386
+ - name : Prebuild Native Modules for macOS
387
+ if : matrix.os == 'macos-latest'
393
388
env :
394
389
CC : clang
395
390
CXX : clang++
391
+ run : npm run prebuild-darwin-x64+arm64
392
+ - name : Validate macOS Prebuild Artifacts
396
393
if : matrix.os == 'macos-latest'
397
- - run : file prebuilds/*/*
398
- if : matrix.os == 'macos-latest'
399
- - name : Extra for cross build
394
+ run : file prebuilds/*/*
395
+ - name : Cross-Build for ARM64 on Ubuntu
400
396
if : matrix.os == 'ubuntu-22.04'
401
397
run : npm run prebuild-arm64
402
- - uses : actions/upload-artifact@v3
398
+ - name : Upload Prebuild Artifacts
399
+ uses : actions/upload-artifact@v4
403
400
with :
404
401
name : prebuilds
405
402
path : prebuilds
406
403
retention-days : 1
407
404
408
405
publish_javascript :
409
- name : Publish JavaScript
406
+ name : Publish JavaScript Package
410
407
needs : build_javascript
411
408
runs-on : ubuntu-22.04
412
-
413
409
steps :
414
- - uses : actions/checkout@v4
410
+ - name : Checkout Repository
411
+ uses : actions/checkout@v4
415
412
with :
416
413
ref : " main"
417
- - run : git submodule update --init --recursive
418
-
419
- - name : Set up Node.js
414
+ - name : Update Git Submodules
415
+ run : git submodule update --init --recursive
416
+ - name : Set Up Node.js Environment
420
417
uses : actions/setup-node@v4
421
418
with :
422
- node-version : 20
423
-
424
- - uses : actions/download-artifact@v3
425
-
426
- - name : Look for links
419
+ node-version : " 20"
420
+ - name : Download Prebuild Artifacts
421
+ uses : actions/download-artifact@v4
422
+ with :
423
+ name : prebuilds
424
+ path : prebuilds
425
+ - name : Verify File Hard Links (Optional)
427
426
run : find . -type f -links +1
428
-
429
- - name : Install dependencies
427
+ - name : Install Node.js Dependencies
430
428
run : npm ci --ignore-scripts
431
-
432
- - name : Build the JS from TS
429
+ - name : Build JavaScript from TypeScript
433
430
run : npm run build-js
434
-
435
- - name : Last minute test with prebuild artifact
431
+ - name : Run Final Tests with Prebuild Artifacts
436
432
run : npm run test
437
-
438
- - name : Publish Dry Run
439
- run : npm publish --dry-run
433
+ - name : Dry Run Publish to NPM
440
434
if : github.ref != 'refs/heads/main'
441
-
442
- - name : Publish
443
- uses : JS-DevTools/npm-publish@v3
435
+ run : npm publish --dry-run
436
+ - name : Publish to NPM
444
437
if : github.ref == 'refs/heads/main'
438
+ uses : JS-DevTools/npm-publish@v3
445
439
with :
446
440
token : ${{ secrets.NPM_TOKEN }}
447
441
access : public
448
442
449
443
publish_rust :
450
- name : Publish Rust
444
+ name : Publish Rust Crate
451
445
needs : versioning
452
446
runs-on : ubuntu-22.04
453
447
steps :
454
- - uses : actions/checkout@v4
448
+ - name : Checkout Repository
449
+ uses : actions/checkout@v4
455
450
with :
456
451
ref : " main"
457
- - run : git submodule update --init --recursive
458
- - uses : actions-rs/toolchain@v1
452
+ - name : Update Git Submodules
453
+ run : git submodule update --init --recursive
454
+ - name : Set Up Rust Toolchain
455
+ uses : actions-rs/toolchain@v1
459
456
with :
460
457
toolchain : stable
461
458
override : true
462
- - uses : katyo/publish-crates@v2
459
+ - name : Publish Rust Crate to Registry
460
+ uses : katyo/publish-crates@v2
463
461
with :
464
462
registry-token : ${{ secrets.CARGO_REGISTRY_TOKEN }}
0 commit comments