Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding macOS pre-built binaries #246

Merged
merged 37 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b1d83ba
testing macOS build
agracio Mar 5, 2025
6383b54
testing macOS build
agracio Mar 5, 2025
6654fc5
testing macOS build
agracio Mar 5, 2025
ad44e6a
testing macOS build
agracio Mar 5, 2025
57cf4d7
testing macOS build
agracio Mar 5, 2025
02869a2
testing macOS build
agracio Mar 5, 2025
30d4a6e
testing macOS build
agracio Mar 5, 2025
c415844
testing macOS build
agracio Mar 5, 2025
ea5cca1
testing macOS build
agracio Mar 5, 2025
1798a13
testing macOS build
agracio Mar 5, 2025
bf6bd10
testing macOS build
agracio Mar 6, 2025
fb64dfe
testing macOS build
agracio Mar 6, 2025
6f96222
testing macOS build
agracio Mar 6, 2025
d84c10d
testing macOS build
agracio Mar 6, 2025
7e70f79
testing macOS build
agracio Mar 6, 2025
0b4242d
testing macOS build
agracio Mar 6, 2025
d48a6bb
testing macOS build
agracio Mar 6, 2025
792d6c0
testing macOS build
agracio Mar 6, 2025
6d5a607
testing macOS build
agracio Mar 6, 2025
43853ae
testing macOS build
agracio Mar 6, 2025
558db44
testing macOS build
agracio Mar 6, 2025
c68f2c7
testing macOS build
agracio Mar 6, 2025
59272d8
testing macOS build
agracio Mar 6, 2025
a31b913
testing macOS build
agracio Mar 6, 2025
afe3f93
testing macOS build
agracio Mar 6, 2025
c12e0ea
testing macOS build
agracio Mar 6, 2025
7038be7
testing macOS build
agracio Mar 6, 2025
02ba28b
testing macOS build
agracio Mar 6, 2025
9a59070
testing macOS build
agracio Mar 6, 2025
867cf39
testing macOS build
agracio Mar 7, 2025
9c4edaf
testing macOS build
agracio Mar 7, 2025
f3c5cff
testing macOS build
agracio Mar 7, 2025
dadf069
testing macOS build
agracio Mar 7, 2025
48f28dc
testing macOS build
agracio Mar 7, 2025
1fa27d9
testing macOS build
agracio Mar 7, 2025
acad6c0
testing macOS build
agracio Mar 7, 2025
402ff6a
testing macOS build
agracio Mar 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ workflows:
matrix:
parameters:
# os: ['linux', 'linux-arm', 'macos']
os: ['linux-arm']
os: ['linux', 'linux-arm']
node-version: ['14', '16' ,'18', '20', '22', '23']

63 changes: 47 additions & 16 deletions .github/actions/build-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
uses: ./.github/actions/setup-env
with:
node: 20
os: windows-2022
os: ${{ inputs.os }}

- name: Get latest Node.js version for v${{ inputs.node }}
id: node-test-version
Expand All @@ -37,12 +37,18 @@ runs:
script: |
try {
const fs = require('fs')
if(${{ inputs.node }} <23){
fs.mkdirSync('release/ia32/${{ inputs.node }}', { recursive: true });
if('${{ runner.os }}' == 'Windows'){
if(${{ inputs.node }} <23){
fs.mkdirSync('release/win32/ia32/${{ inputs.node }}', { recursive: true });
}
fs.mkdirSync('release/win32/x64/${{ inputs.node }}', { recursive: true });
if(${{ inputs.node }} >=20){
fs.mkdirSync('release/win32/arm64/${{ inputs.node }}', { recursive: true });
}
}
fs.mkdirSync('release/x64/${{ inputs.node }}', { recursive: true });
if(${{ inputs.node }} >=20){
fs.mkdirSync('release/arm64/${{ inputs.node }}', { recursive: true });
else if('${{ runner.os }}' == 'macOS'){
fs.mkdirSync(`release/${process.platform}/x64/${{ inputs.node }}`, { recursive: true });
fs.mkdirSync(`release/${process.platform}/arm64/${{ inputs.node }}`, { recursive: true });
}
} catch(err) {
core.error("Error creating release directory")
Expand All @@ -56,28 +62,44 @@ runs:
script: |
try {
const fs = require('fs')
if(${{ inputs.node }} <23){
fs.writeFileSync('release/ia32/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
if('${{ runner.os }}' == 'Windows'){
if(${{ inputs.node }} <23){
fs.writeFileSync('release/win32/ia32/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
}
fs.writeFileSync('release/win32/x64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
if(${{ inputs.node }} >=20){
fs.writeFileSync('release/win32/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
}
}
fs.writeFileSync('release/x64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
if(${{ inputs.node }} >=20){
fs.writeFileSync('release/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
else if('${{ runner.os }}' == 'macOS'){
fs.writeFileSync(`release/${process.platform}/x64/${{ inputs.node }}/node.version`, '${{ steps.node-test-version.outputs.node-version }}');
fs.writeFileSync(`release/${process.platform}/arm64/${{ inputs.node }}/node.version`, '${{ steps.node-test-version.outputs.node-version }}');
}
} catch(err) {
core.error("Error writing node.version file")
core.setFailed(err)
}

- name: Cache node-gyp
- name: Cache node-gyp Windows
if: runner.os == 'Windows'
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~\AppData\Local\node-gyp\Cache
key: ${{ steps.node-test-version.outputs.node-version }}

- name: Cache node-gyp macOS
if: runner.os == 'macOS'
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~/Library/Caches/node-gyp
key: '${{ inputs.os }}-${{ inputs.node}}'

- name: Build ia32
if: ${{ inputs.node <23 }}
if: (runner.os == 'Windows') && (inputs.node <23)
uses: ./.github/actions/build
with:
node: ${{ steps.node-test-version.outputs.node-version }}
Expand All @@ -92,7 +114,7 @@ runs:
arch: 'x64'

- name: Build arm64
if: ${{ inputs.node >=20 }}
if: (inputs.node >=20) || (runner.os == 'macOS')
uses: ./.github/actions/build
with:
node: ${{ steps.node-test-version.outputs.node-version }}
Expand All @@ -101,8 +123,17 @@ runs:

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
if: runner.os == 'Windows' && success()
with:
name: win32-edge-js-${{ inputs.node }}
path: |
release

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: runner.os == 'macOS' && success()
with:
name: edge-js-${{ inputs.node }}
name: darwin-edge-js-${{ inputs.node }}
path: |
release

13 changes: 10 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ runs:
run: |
node-gyp configure --target=${{ inputs.node }} --runtime=node --release --arch=${{ inputs.arch }}

if ( '${{ inputs.arch }}' -eq 'arm64'){
if ( '${{ inputs.arch }}' -eq 'arm64' -And '${{ runner.os }}' -eq 'Windows'){
(Get-Content -Raw build/build_managed.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}

node-gyp build
cmd /c copy /y build\Release\edge_*.node release\${{ inputs.arch }}\${{ inputs.node-major }}
cmd /c rmdir /S /Q build
if ( '${{ runner.os }}' -eq 'Windows'){
cmd /c copy /y build\Release\edge_*.node release\win32\${{ inputs.arch }}\${{ inputs.node-major }}
cmd /c rmdir /S /Q build
}

if ( '${{ runner.os }}' -eq 'macOS'){
Copy-Item "build/Release/edge_coreclr.node" -Destination "release/darwin/${{ inputs.arch }}/${{ inputs.node-major }}"
node-gyp clean
}
24 changes: 15 additions & 9 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ runs:
path: ~/.cache/node-gyp
key: '${{ inputs.os }}-${{ inputs.node}}'

- name: Cache node-gyp macOs
if: runner.os == 'macOS'
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~/Library/Caches/node-gyp
key: '${{ inputs.os }}-${{ inputs.node}}'
# - name: Cache node-gyp macOs
# if: runner.os == 'macOS'
# uses: actions/cache@v4
# env:
# cache-name: cache-node-gyp
# with:
# path: ~/Library/Caches/node-gyp
# key: '${{ inputs.os }}-${{ inputs.node}}'



- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v4
Expand All @@ -57,6 +57,12 @@ runs:
run: |
node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch

- if: runner.os == 'macOS' && inputs.node <= 16
shell: bash
name: Add missing packages for macOS NodeJs 16
run: |
pip install setuptools

- name: npm install
shell: bash
run: npm i
101 changes: 89 additions & 12 deletions .github/actions/test-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,120 @@ runs:
using: "composite"
steps:

- name: Setup env
uses: ./.github/actions/setup-env
with:
node: ${{ inputs.node }}
os: ${{ inputs.os }}

- name: Create release folder
if: runner.os == 'Windows'
shell: pwsh
run: |
cmd /c if not exist "lib\native\win32\ia32\${{ inputs.node }}" mkdir "lib\native\win32\ia32\${{ inputs.node }}"
cmd /c if not exist "lib\native\win32\x64\${{ inputs.node }}" mkdir "lib\native\win32\x64\${{ inputs.node }}"
cmd /c if not exist "lib\native\win32\arm64\${{ inputs.node }}" mkdir "lib\native\win32\arm64\${{ inputs.node }}"

- name: Create release folder
if: runner.os == 'macOS'
uses: actions/github-script@v7
with:
result-encoding: string
script: |
try {
const fs = require('fs')
fs.mkdirSync('lib/native/darwin/x64/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('lib/native/darwin/arm64/${{ inputs.node }}', { recursive: true });
} catch(err) {
core.error("Error creating release directory")
core.setFailed(err)
}

- name: Download artifacts
if: runner.os == 'Windows'
uses: actions/download-artifact@v4
with:
path: release
pattern: win32-edge-js-${{ inputs.node }}*

- name: Download artifacts
if: runner.os == 'macOS'
uses: actions/download-artifact@v4
with:
path: release
pattern: edge-js-${{ inputs.node }}*
pattern: darwin-edge-js-${{ inputs.node }}*

- name: List artifacts
shell: bash
run: ls -R release

- name: Copy artifacts
if: runner.os == 'Windows'
shell: pwsh
run: |
cmd /c copy /y release\edge-js-${{ inputs.node }}\x64\${{ inputs.node }}\edge_*.node lib\native\win32\x64\${{ inputs.node }}
cmd /c copy /y release\win32-edge-js-${{ inputs.node }}\win32\x64\${{ inputs.node }}\edge_*.node lib\native\win32\x64\${{ inputs.node }}

- name: Copy artifacts
if: runner.os == 'macOS'
uses: actions/github-script@v7
with:
result-encoding: string
script: |
try {
const fs = require('fs')
fs.copyFileSync('release/darwin-edge-js-${{ inputs.node }}/darwin/x64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/x64/${{ inputs.node }}/edge_coreclr.node');
fs.copyFileSync('release/darwin-edge-js-${{ inputs.node }}/darwin/arm64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/arm64/${{ inputs.node }}/edge_coreclr.node');
} catch(err) {
core.error("Error creating release directory")
core.setFailed(err)
}

- name: Test
uses: ./.github/actions/test-windows
- name: Setup env
uses: ./.github/actions/setup-env
with:
node: ${{ inputs.node }}

os: ${{ inputs.os }}

- name: Check edge-js Windows pre-built files
if: runner.os == 'Windows'
uses: andstor/file-existence-action@v3
with:
files: "lib/native/win32/${{ runner.arch }}/${{ inputs.node }}/edge_coreclr.node, lib/native/win32/${{ runner.arch }}/${{ inputs.node }}/edge_nativeclr.node"
fail: true
ignore_case: true

- name: Check edge-js macOS pre-built files
if: runner.os == 'macOS'
uses: andstor/file-existence-action@v3
with:
files: "lib/native/darwin/${{ runner.arch }}/${{ inputs.node }}/edge_coreclr.node"
fail: true
ignore_case: true

- name: Run .NET 4.5 tests
if: runner.os == 'Windows'
shell: bash
run: node tools/test.js CI

- name: "Run .net core tests"
shell: bash
run: node tools/test.js CI
env:
EDGE_USE_CORECLR: 1

- name: Test report
uses: ./.github/actions/create-test-report
with:
node: ${{ inputs.node }}
os: ${{ inputs.os }}
name: 'build-tests'


- name: publish test-summary nacOS
if: runner.os == 'macOS'
uses: EnricoMi/publish-unit-test-result-action/macos@v2
with:
check_run_annotations: 'none'
check_name: 'test-summary node-${{ inputs.node }} ${{ inputs.os }}'
files: "test-results.xml"

- name: publish test-summary Windows
if: runner.os == 'Windows'
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
check_run_annotations: 'none'
check_name: 'test-summary node-${{ inputs.node }} ${{ inputs.os }}'
files: "test-results.xml"
33 changes: 0 additions & 33 deletions .github/actions/test-windows/action.yml

This file was deleted.

Loading
Loading