Skip to content

Commit

Permalink
testing macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Mar 6, 2025
1 parent d48a6bb commit 792d6c0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
27 changes: 10 additions & 17 deletions .github/actions/build-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ runs:
const fs = require('fs')
if('${{ runner.os }}' == 'Windows'){
if(${{ inputs.node }} <23){
fs.mkdirSync('release/ia32/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('release/win32/ia32/${{ inputs.node }}', { recursive: true });
}
fs.mkdirSync('release/x64/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('release/win32/x64/${{ inputs.node }}', { recursive: true });
if(${{ inputs.node }} >=20){
fs.mkdirSync('release/arm64/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('release/win32/arm64/${{ inputs.node }}', { recursive: true });
}
}
else if('${{ runner.os }}' == 'macOS'){
fs.mkdirSync('release/ia32/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('release/x64/${{ inputs.node }}', { recursive: true });
fs.mkdirSync('release/arm64/${{ inputs.node }}', { recursive: true });
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 @@ -65,28 +64,22 @@ runs:
const fs = require('fs')
if('${{ runner.os }}' == 'Windows'){
if(${{ inputs.node }} <23){
fs.writeFileSync('release/ia32/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
fs.writeFileSync('release/win32/ia32/${{ 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 }}');
fs.writeFileSync('release/win32/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 }}');
fs.writeFileSync('release/win32/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
}
}
else if('${{ runner.os }}' == 'macOS'){
fs.writeFileSync('release/x64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
fs.writeFileSync('release/arm64/${{ inputs.node }}/node.version', '${{ steps.node-test-version.outputs.node-version }}');
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)
}
- if: runner.os == 'macOS' && inputs.node == 16
shell: bash
name: Add missing packages for macOS NodeJs 16
run: |
pip install setuptools
- name: Cache node-gyp Windows
if: runner.os == 'Windows'
uses: actions/cache@v4
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ runs:
# path: ~/Library/Caches/node-gyp
# key: '${{ inputs.os }}-${{ inputs.node}}'


- if: runner.os == 'macOS' && inputs.node == 16
shell: bash
name: Add missing packages for macOS NodeJs 16
run: |
pip install setuptools
- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/test-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ runs:
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'
Expand All @@ -60,13 +60,13 @@ runs:
script: |
try {
const fs = require('fs')
fs.copyFileSync('release/edge-js-${{ inputs.node }}/x64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/x64/${{ inputs.node }}/edge_coreclr.node');
fs.copyFileSync('release/edge-js-${{ inputs.node }}/x64/${{ inputs.node }}/edge_coreclr.node', 'lib/native/darwin/arm64/${{ inputs.node }}/edge_coreclr.node');
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: Setup env
uses: ./.github/actions/setup-env
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
os: [macos-14]
fail-fast: true

name: build node-${{ inputs.build-version }}
name: build node-${{ inputs.build-version }} ${{ matrix.os }}
steps:

- name: Checkout code
Expand All @@ -50,7 +50,7 @@ jobs:
matrix:
# os: [windows-2022]
os: [macos-13, macos-14]
# fail-fast: false
fail-fast: false

name: test ${{ matrix.os }}-node-${{ inputs.build-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
# os: [macos-13, macos-14, ubuntu-22.04, ubuntu-22.04-arm, windows-2022]
os: [macos-13, macos-14, macos-15]
# node: [18, 20, 22, 23]
node: [20]
node: [16, 20]
steps:

- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion lib/edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if (process.env.EDGE_USE_CORECLR && !process.env.EDGE_BOOTSTRAP_DIR && fs.exists
}

process.env.EDGE_NATIVE = edgeNative;

console.log('edgeNative', edgeNative)
edge = require(edgeNative);

exports.func = function(language, options) {
Expand Down

0 comments on commit 792d6c0

Please sign in to comment.