From e0820311df5fc5592dd0fc257f99f5429f400050 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 16:33:49 +0100 Subject: [PATCH 01/36] remove qemu --- .../workflows/release-node-bindings-ref.yml | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 2d8ec40c..4380fc8d 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -111,7 +111,7 @@ jobs: target: aarch64-apple-darwin - host: ubuntu-latest target: x86_64-unknown-linux-gnu - - host: ubuntu-latest + - host: linux-arm64 target: aarch64-unknown-linux-gnu - host: windows-latest target: x86_64-pc-windows-msvc @@ -151,24 +151,10 @@ jobs: run: yarn test working-directory: bindings/node - # Emulated testing for aarch64 Linux - - name: Set up QEMU - if: matrix.settings.target == 'aarch64-unknown-linux-gnu' - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - name: Test bindings (Linux ARM64) if: matrix.settings.target == 'aarch64-unknown-linux-gnu' - uses: addnab/docker-run-action@v3 - with: - image: node:${{ matrix.node }}-slim - options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' - run: | - cd bindings/node - yarn config set supportedArchitectures.cpu "arm64" - yarn config set supportedArchitectures.libc "glibc" - yarn install - yarn test + run: yarn test + working-directory: bindings/node # Native testing for x86_64 Windows - name: Test bindings (Windows x86_64) From b2013a59c207f10e5faf73219272cf98f29c0bd7 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 16:47:24 +0100 Subject: [PATCH 02/36] remove qemu for windows --- .../workflows/release-node-bindings-ref.yml | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 4380fc8d..fd07cbb1 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -115,7 +115,7 @@ jobs: target: aarch64-unknown-linux-gnu - host: windows-latest target: x86_64-pc-windows-msvc - - host: ubuntu-latest + - host: windows-arm64 target: aarch64-pc-windows-msvc node: - '20' @@ -161,28 +161,12 @@ jobs: if: matrix.settings.target == 'x86_64-pc-windows-msvc' run: yarn test working-directory: bindings/node - # TODO: Its kind of hard to test windows on arm64 w yarn - # The approach of using linaro/wine-arm64 is the most promising - # We can add it back after some debugging - # - name: Test bindings (Windows ARM64) - # if: matrix.settings.target == 'aarch64-pc-windows-msvc' - # uses: addnab/docker-run-action@v3 - # with: - # image: linaro/wine-arm64 - # options: '-v ${{ github.workspace }}:/build -w /build' - # run: | - # echo "Download node windows-arm64" - # NODE_VERSION=20.0.0 - # wget -q https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-win-arm64.zip - # unzip -q node-*.zip - # mv node-*-win-arm64 /node - - # cd bindings/node - # echo "Run tests" - # wine-arm64 /node/node.exe --version - # wine-arm64 /node/npm.cmd install -g yarn - # wine-arm64 /node/yarn.cmd install - # wine-arm64 /node/yarn.cmd test + + # Native testing for arm64 Windows + - name: Test bindings (Windows arm64) + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + run: yarn test + working-directory: bindings/node publish: name: Publish From 0c37e726b527e74ab93f8c91a183d04235987e9a Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 16:48:58 +0100 Subject: [PATCH 03/36] update runner name --- .github/workflows/release-node-bindings-ref.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index fd07cbb1..6e4262df 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -115,7 +115,7 @@ jobs: target: aarch64-unknown-linux-gnu - host: windows-latest target: x86_64-pc-windows-msvc - - host: windows-arm64 + - host: win-arm64 target: aarch64-pc-windows-msvc node: - '20' From 0ff3eb927815a748461bc74002a674a5bb51eafe Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:13:01 +0100 Subject: [PATCH 04/36] remove other builds and use choco to install latest git --- .../workflows/release-node-bindings-ref.yml | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 6e4262df..9ca76bc7 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -33,16 +33,16 @@ jobs: fail-fast: false matrix: settings: - - host: macos-13 - target: x86_64-apple-darwin - - host: macos-14 - target: aarch64-apple-darwin - - host: ubuntu-latest - target: x86_64-unknown-linux-gnu - - host: ubuntu-latest - target: aarch64-unknown-linux-gnu - - host: ubuntu-latest - target: x86_64-pc-windows-msvc + # - host: macos-13 + # target: x86_64-apple-darwin + # - host: macos-14 + # target: aarch64-apple-darwin + # - host: ubuntu-latest + # target: x86_64-unknown-linux-gnu + # - host: ubuntu-latest + # target: aarch64-unknown-linux-gnu + # - host: ubuntu-latest + # target: x86_64-pc-windows-msvc - host: ubuntu-latest target: aarch64-pc-windows-msvc @@ -105,16 +105,16 @@ jobs: fail-fast: false matrix: settings: - - host: macos-13 - target: x86_64-apple-darwin - - host: macos-14 - target: aarch64-apple-darwin - - host: ubuntu-latest - target: x86_64-unknown-linux-gnu - - host: linux-arm64 - target: aarch64-unknown-linux-gnu - - host: windows-latest - target: x86_64-pc-windows-msvc + # - host: macos-13 + # target: x86_64-apple-darwin + # - host: macos-14 + # target: aarch64-apple-darwin + # - host: ubuntu-latest + # target: x86_64-unknown-linux-gnu + # - host: linux-arm64 + # target: aarch64-unknown-linux-gnu + # - host: windows-latest + # target: x86_64-pc-windows-msvc - host: win-arm64 target: aarch64-pc-windows-msvc node: @@ -123,6 +123,14 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: + - name: Install Git + uses: crazy-max/ghaction-chocolatey@v3 + with: + args: install git -y + + - name: Check Git version + run: git --version + - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} From 9b4452416878e88466718bbbb0ba7b467ad29540 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:25:53 +0100 Subject: [PATCH 05/36] try manually installing git -- CI says choco is not installed --- .../workflows/release-node-bindings-ref.yml | 103 +++++++++--------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 9ca76bc7..29612f95 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -52,52 +52,52 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.settings.target }} - # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) - # Alternatively, you can install llvm - - name: Install llvm-preview-tools - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: rustup component add llvm-tools-preview - - name: Install dependencies - run: yarn install - working-directory: bindings/node - - name: Setup Zig (Linux only) - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.13.0 - - name: Install cargo-zigbuild (Linux only) - if: runner.os == 'Linux' - run: cargo install cargo-zigbuild - - name: Install cargo-xwin (Windows on Linux only) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: cargo install cargo-xwin - - name: Build (macOS) - if: runner.os == 'macOS' - run: | - rustup target add ${{ matrix.settings.target }} - yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Linux) - if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') - run: yarn build --zig --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Windows on Linux) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.settings.target }} - path: bindings/node/${{ env.APP_NAME }}.*.node - if-no-files-found: error + # - name: Setup node + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # - name: Install Rust toolchain + # uses: dtolnay/rust-toolchain@stable + # with: + # targets: ${{ matrix.settings.target }} + # # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) + # # Alternatively, you can install llvm + # - name: Install llvm-preview-tools + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: rustup component add llvm-tools-preview + # - name: Install dependencies + # run: yarn install + # working-directory: bindings/node + # - name: Setup Zig (Linux only) + # uses: goto-bus-stop/setup-zig@v2 + # with: + # version: 0.13.0 + # - name: Install cargo-zigbuild (Linux only) + # if: runner.os == 'Linux' + # run: cargo install cargo-zigbuild + # - name: Install cargo-xwin (Windows on Linux only) + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: cargo install cargo-xwin + # - name: Build (macOS) + # if: runner.os == 'macOS' + # run: | + # rustup target add ${{ matrix.settings.target }} + # yarn build --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Build (Linux) + # if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') + # run: yarn build --zig --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Build (Windows on Linux) + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: yarn build --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Upload artifact + # uses: actions/upload-artifact@v4 + # with: + # name: bindings-${{ matrix.settings.target }} + # path: bindings/node/${{ env.APP_NAME }}.*.node + # if-no-files-found: error test: needs: build @@ -124,9 +124,14 @@ jobs: runs-on: ${{ matrix.settings.host }} steps: - name: Install Git - uses: crazy-max/ghaction-chocolatey@v3 - with: - args: install git -y + run: | + $gitVersion = "2.42.0.2" + $url = "https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.2/Git-$gitVersion-64-bit.exe" + $output = "$env:TEMP\GitInstaller.exe" + Invoke-WebRequest -Uri $url -OutFile $output + Start-Process -FilePath $output -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait + $env:PATH += ";C:\Program Files\Git\cmd" + shell: powershell - name: Check Git version run: git --version From 6e45e7143ebd26227c362a58e01eacbe96aec8bc Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:30:55 +0100 Subject: [PATCH 06/36] remove full installer -- windows cuts off the connection --- .github/workflows/release-node-bindings-ref.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 29612f95..9a09356d 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,15 +123,6 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: - - name: Install Git - run: | - $gitVersion = "2.42.0.2" - $url = "https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.2/Git-$gitVersion-64-bit.exe" - $output = "$env:TEMP\GitInstaller.exe" - Invoke-WebRequest -Uri $url -OutFile $output - Start-Process -FilePath $output -Args "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS='icons,ext\reg\shellhere,assoc,assoc_sh'" -Wait - $env:PATH += ";C:\Program Files\Git\cmd" - shell: powershell - name: Check Git version run: git --version From ee56b4d327566b10a3f81a50418397a6c873bbd3 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:36:36 +0100 Subject: [PATCH 07/36] try checking for windows native version of git (arm64) --- .github/workflows/release-node-bindings-ref.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 9a09356d..a18edfbb 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,6 +123,17 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: + - name: Check for Windows-native Git + shell: powershell + run: | + $gitPath = "C:\Program Files\Git\cmd\git.exe" + if (Test-Path $gitPath) { + Write-Host "Windows-native Git found" + $env:PATH += ";C:\Program Files\Git\cmd" + git --version + } else { + Write-Host "Windows-native Git not found" + } - name: Check Git version run: git --version From 59098be750e4f79f6ca28870d261d712542a09cd Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:38:04 +0100 Subject: [PATCH 08/36] try looking for wsl git --- .github/workflows/release-node-bindings-ref.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index a18edfbb..450394dd 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,16 +123,14 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: - - name: Check for Windows-native Git + - name: Check for WSL Git shell: powershell run: | - $gitPath = "C:\Program Files\Git\cmd\git.exe" - if (Test-Path $gitPath) { - Write-Host "Windows-native Git found" - $env:PATH += ";C:\Program Files\Git\cmd" - git --version + if (Get-Command wsl -ErrorAction SilentlyContinue) { + Write-Host "WSL is available, checking for Git" + wsl git --version } else { - Write-Host "Windows-native Git not found" + Write-Host "WSL is not available" } - name: Check Git version From 3dba5c731e8b48171749c170892d6901c0e4c28e Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:42:03 +0100 Subject: [PATCH 09/36] website says we can use winget --- .../workflows/release-node-bindings-ref.yml | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 450394dd..76cdea4e 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,16 +123,33 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: - - name: Check for WSL Git + + - name: Check for winget shell: powershell run: | - if (Get-Command wsl -ErrorAction SilentlyContinue) { - Write-Host "WSL is available, checking for Git" - wsl git --version + if (Get-Command winget -ErrorAction SilentlyContinue) { + Write-Host "winget is already installed" } else { - Write-Host "WSL is not available" + Write-Host "winget is not installed" } + - name: Install winget + shell: powershell + run: | + $progressPreference = 'silentlyContinue' + Write-Information "Downloading WinGet and its dependencies..." + Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle + Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx + Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile Microsoft.UI.Xaml.2.7.x64.appx + Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx + Add-AppxPackage Microsoft.UI.Xaml.2.7.x64.appx + Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle + + - name: Install Git using winget + shell: powershell + run: | + winget install --id Git.Git -e --source winget --accept-package-agreements --accept-source-agreements + - name: Check Git version run: git --version From afd151c17264b68db60b32cb44f81bbf9e642c30 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:45:47 +0100 Subject: [PATCH 10/36] install choco --- .../workflows/release-node-bindings-ref.yml | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 76cdea4e..5b0894f7 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -124,31 +124,12 @@ jobs: runs-on: ${{ matrix.settings.host }} steps: - - name: Check for winget + - name: Install Chocolatey shell: powershell run: | - if (Get-Command winget -ErrorAction SilentlyContinue) { - Write-Host "winget is already installed" - } else { - Write-Host "winget is not installed" - } - - - name: Install winget - shell: powershell - run: | - $progressPreference = 'silentlyContinue' - Write-Information "Downloading WinGet and its dependencies..." - Invoke-WebRequest -Uri https://aka.ms/getwinget -OutFile Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx - Invoke-WebRequest -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile Microsoft.UI.Xaml.2.7.x64.appx - Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx - Add-AppxPackage Microsoft.UI.Xaml.2.7.x64.appx - Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle - - - name: Install Git using winget - shell: powershell - run: | - winget install --id Git.Git -e --source winget --accept-package-agreements --accept-source-agreements + Set-ExecutionPolicy Bypass -Scope Process -Force + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - name: Check Git version run: git --version From ad78198d72efcc93f91d4b7ccb1decf6fc4c1c1d Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:48:31 +0100 Subject: [PATCH 11/36] install git using choco --- .github/workflows/release-node-bindings-ref.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 5b0894f7..26953c5e 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -130,9 +130,16 @@ jobs: Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + - name: Install Git using Chocolatey + shell: powershell + run: | + choco install git -y - - name: Check Git version - run: git --version + - name: Verify Git installation + shell: powershell + run: | + refreshenv + git --version - uses: actions/checkout@v4 with: From 2120f2182adc6fa116f33b6c9019d1e045fb44a0 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:52:54 +0100 Subject: [PATCH 12/36] refreshenv after installing choco --- .github/workflows/release-node-bindings-ref.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 26953c5e..92fe0842 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -133,6 +133,7 @@ jobs: - name: Install Git using Chocolatey shell: powershell run: | + refreshenv choco install git -y - name: Verify Git installation From a4b79c3e2c7c09d2e926f578315ec208ed383298 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:56:51 +0100 Subject: [PATCH 13/36] manually add choco to path --- .github/workflows/release-node-bindings-ref.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 92fe0842..eac98c7b 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -130,10 +130,15 @@ jobs: Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + - name: Add Chocolatey to PATH + shell: powershell + run: | + $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" + [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") + Write-Host "Updated PATH: $env:PATH" - name: Install Git using Chocolatey shell: powershell run: | - refreshenv choco install git -y - name: Verify Git installation From e71fa1a46d1dd805c64637d188b70638abc69673 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 17:59:11 +0100 Subject: [PATCH 14/36] try to use the full path to choco --- .github/workflows/release-node-bindings-ref.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index eac98c7b..82d7f802 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -139,7 +139,7 @@ jobs: - name: Install Git using Chocolatey shell: powershell run: | - choco install git -y + C:\ProgramData\chocolatey\bin\choco.exe install git -y - name: Verify Git installation shell: powershell From 9b1a3d6af8dcc7c53c2a6b5dfb70a10e75429983 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:03:40 +0100 Subject: [PATCH 15/36] add back build and remove refreshenv --- .../workflows/release-node-bindings-ref.yml | 93 +++++++++---------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 82d7f802..790b06e0 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -52,52 +52,52 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - # - name: Setup node - # uses: actions/setup-node@v4 - # with: - # node-version: 20 - # - name: Install Rust toolchain - # uses: dtolnay/rust-toolchain@stable - # with: - # targets: ${{ matrix.settings.target }} - # # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) - # # Alternatively, you can install llvm - # - name: Install llvm-preview-tools - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: rustup component add llvm-tools-preview - # - name: Install dependencies - # run: yarn install - # working-directory: bindings/node - # - name: Setup Zig (Linux only) - # uses: goto-bus-stop/setup-zig@v2 - # with: - # version: 0.13.0 - # - name: Install cargo-zigbuild (Linux only) - # if: runner.os == 'Linux' - # run: cargo install cargo-zigbuild - # - name: Install cargo-xwin (Windows on Linux only) - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: cargo install cargo-xwin - # - name: Build (macOS) - # if: runner.os == 'macOS' - # run: | - # rustup target add ${{ matrix.settings.target }} - # yarn build --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Build (Linux) - # if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') - # run: yarn build --zig --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Build (Windows on Linux) - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: yarn build --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Upload artifact - # uses: actions/upload-artifact@v4 - # with: - # name: bindings-${{ matrix.settings.target }} - # path: bindings/node/${{ env.APP_NAME }}.*.node - # if-no-files-found: error + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.settings.target }} + # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) + # Alternatively, you can install llvm + - name: Install llvm-preview-tools + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: rustup component add llvm-tools-preview + - name: Install dependencies + run: yarn install + working-directory: bindings/node + - name: Setup Zig (Linux only) + uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.13.0 + - name: Install cargo-zigbuild (Linux only) + if: runner.os == 'Linux' + run: cargo install cargo-zigbuild + - name: Install cargo-xwin (Windows on Linux only) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: cargo install cargo-xwin + - name: Build (macOS) + if: runner.os == 'macOS' + run: | + rustup target add ${{ matrix.settings.target }} + yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Linux) + if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') + run: yarn build --zig --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Windows on Linux) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: bindings/node/${{ env.APP_NAME }}.*.node + if-no-files-found: error test: needs: build @@ -144,7 +144,6 @@ jobs: - name: Verify Git installation shell: powershell run: | - refreshenv git --version - uses: actions/checkout@v4 From ccd5febcc97fad0746651b67ab36434f36565595 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:13:13 +0100 Subject: [PATCH 16/36] try to manually refresh the environment --- .github/workflows/release-node-bindings-ref.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 790b06e0..39d44997 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -140,6 +140,20 @@ jobs: shell: powershell run: | C:\ProgramData\chocolatey\bin\choco.exe install git -y + + - name: Refresh environment and verify Git installation + shell: powershell + run: | + & "C:\ProgramData\chocolatey\bin\RefreshEnv.cmd" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + Write-Host "Current PATH: $env:Path" + if (Get-Command git -ErrorAction SilentlyContinue) { + git --version + } else { + Write-Host "Git command not found. Checking installation directory:" + Get-ChildItem "C:\Program Files\Git" -Recurse + throw "Git not found in PATH" + } - name: Verify Git installation shell: powershell From 1dc7169e78874bab921e6b9111d81bee93b48c37 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:13:36 +0100 Subject: [PATCH 17/36] remove build again --- .../workflows/release-node-bindings-ref.yml | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 39d44997..522d2e7f 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -52,52 +52,52 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.settings.target }} - # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) - # Alternatively, you can install llvm - - name: Install llvm-preview-tools - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: rustup component add llvm-tools-preview - - name: Install dependencies - run: yarn install - working-directory: bindings/node - - name: Setup Zig (Linux only) - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.13.0 - - name: Install cargo-zigbuild (Linux only) - if: runner.os == 'Linux' - run: cargo install cargo-zigbuild - - name: Install cargo-xwin (Windows on Linux only) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: cargo install cargo-xwin - - name: Build (macOS) - if: runner.os == 'macOS' - run: | - rustup target add ${{ matrix.settings.target }} - yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Linux) - if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') - run: yarn build --zig --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Windows on Linux) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.settings.target }} - path: bindings/node/${{ env.APP_NAME }}.*.node - if-no-files-found: error + # - name: Setup node + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # - name: Install Rust toolchain + # uses: dtolnay/rust-toolchain@stable + # with: + # targets: ${{ matrix.settings.target }} + # # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) + # # Alternatively, you can install llvm + # - name: Install llvm-preview-tools + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: rustup component add llvm-tools-preview + # - name: Install dependencies + # run: yarn install + # working-directory: bindings/node + # - name: Setup Zig (Linux only) + # uses: goto-bus-stop/setup-zig@v2 + # with: + # version: 0.13.0 + # - name: Install cargo-zigbuild (Linux only) + # if: runner.os == 'Linux' + # run: cargo install cargo-zigbuild + # - name: Install cargo-xwin (Windows on Linux only) + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: cargo install cargo-xwin + # - name: Build (macOS) + # if: runner.os == 'macOS' + # run: | + # rustup target add ${{ matrix.settings.target }} + # yarn build --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Build (Linux) + # if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') + # run: yarn build --zig --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Build (Windows on Linux) + # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + # run: yarn build --release --target ${{ matrix.settings.target }} + # working-directory: bindings/node + # - name: Upload artifact + # uses: actions/upload-artifact@v4 + # with: + # name: bindings-${{ matrix.settings.target }} + # path: bindings/node/${{ env.APP_NAME }}.*.node + # if-no-files-found: error test: needs: build From d5beb2bd2af086bc03fb4edfcbb4c9ee4cf915f3 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:18:12 +0100 Subject: [PATCH 18/36] add import-module --- .github/workflows/release-node-bindings-ref.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 522d2e7f..5230dec6 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -144,7 +144,8 @@ jobs: - name: Refresh environment and verify Git installation shell: powershell run: | - & "C:\ProgramData\chocolatey\bin\RefreshEnv.cmd" + Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 + refreshenv $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") Write-Host "Current PATH: $env:Path" if (Get-Command git -ErrorAction SilentlyContinue) { @@ -153,7 +154,7 @@ jobs: Write-Host "Git command not found. Checking installation directory:" Get-ChildItem "C:\Program Files\Git" -Recurse throw "Git not found in PATH" - } + } - name: Verify Git installation shell: powershell From 42cbdfb9cef191b1bd57869da1e82505191a8523 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:24:36 +0100 Subject: [PATCH 19/36] try to manually add git to path (choc should install it in the official location) --- .../workflows/release-node-bindings-ref.yml | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 5230dec6..75832aaa 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -141,20 +141,40 @@ jobs: run: | C:\ProgramData\chocolatey\bin\choco.exe install git -y - - name: Refresh environment and verify Git installation + - name: Locate Git and add to PATH shell: powershell run: | - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 - refreshenv - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - Write-Host "Current PATH: $env:Path" - if (Get-Command git -ErrorAction SilentlyContinue) { - git --version + $commonPaths = @( + "C:\Program Files\Git\cmd", + "C:\Program Files (x86)\Git\cmd", + "C:\Git\cmd" + ) + $gitPath = $null + foreach ($path in $commonPaths) { + if (Test-Path "$path\git.exe") { + $gitPath = $path + break + } + } + if ($gitPath) { + Write-Host "Git found at: $gitPath" + $env:Path = "$gitPath;$env:Path" + [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine") + Write-Host "Updated PATH: $env:Path" } else { - Write-Host "Git command not found. Checking installation directory:" - Get-ChildItem "C:\Program Files\Git" -Recurse - throw "Git not found in PATH" + Write-Host "Git not found in common locations. Searching Program Files:" + $gitExe = Get-ChildItem "C:\Program Files" -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -eq "git.exe" } | Select-Object -First 1 + if ($gitExe) { + $gitPath = $gitExe.DirectoryName + Write-Host "Git found at: $gitPath" + $env:Path = "$gitPath;$env:Path" + [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine") + Write-Host "Updated PATH: $env:Path" + } else { + throw "Git not found" + } } + - name: Verify Git installation shell: powershell From 61f07c7f3745e65b30c140145f1001c97b76212e Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:30:49 +0100 Subject: [PATCH 20/36] try putting gitpath in GITHUB_PATH --- .../workflows/release-node-bindings-ref.yml | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 75832aaa..26c7c117 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -141,39 +141,34 @@ jobs: run: | C:\ProgramData\chocolatey\bin\choco.exe install git -y - - name: Locate Git and add to PATH + - name: Add Git to PATH and verify installation shell: powershell run: | - $commonPaths = @( - "C:\Program Files\Git\cmd", - "C:\Program Files (x86)\Git\cmd", - "C:\Git\cmd" - ) - $gitPath = $null - foreach ($path in $commonPaths) { - if (Test-Path "$path\git.exe") { - $gitPath = $path - break - } - } - if ($gitPath) { + $gitPath = "C:\Program Files\Git\cmd" + if (Test-Path (Join-Path $gitPath "git.exe")) { Write-Host "Git found at: $gitPath" + + # Update PATH for current process $env:Path = "$gitPath;$env:Path" - [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine") + + # Update PATH for future processes in this job + echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + Write-Host "Updated PATH: $env:Path" - } else { - Write-Host "Git not found in common locations. Searching Program Files:" - $gitExe = Get-ChildItem "C:\Program Files" -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -eq "git.exe" } | Select-Object -First 1 - if ($gitExe) { - $gitPath = $gitExe.DirectoryName - Write-Host "Git found at: $gitPath" - $env:Path = "$gitPath;$env:Path" - [Environment]::SetEnvironmentVariable("Path", $env:Path, "Machine") - Write-Host "Updated PATH: $env:Path" + + # Verify Git is accessible + Write-Host "`nAttempting to run 'git --version':" + git --version + + if ($LASTEXITCODE -eq 0) { + Write-Host "Git successfully added to PATH and is working." } else { - throw "Git not found" + throw "Git command failed. Exit code: $LASTEXITCODE" } + } else { + throw "Git not found at expected location: $gitPath" } + - name: Verify Git installation From 44386490fecbeb81d6843d87b373790d93652353 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:36:53 +0100 Subject: [PATCH 21/36] try just adding git to the path --- .../workflows/release-node-bindings-ref.yml | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 26c7c117..733910f4 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,25 +123,30 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: - - - name: Install Chocolatey - shell: powershell - run: | - Set-ExecutionPolicy Bypass -Scope Process -Force - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - - name: Add Chocolatey to PATH - shell: powershell - run: | - $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" - [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") - Write-Host "Updated PATH: $env:PATH" - - name: Install Git using Chocolatey - shell: powershell - run: | - C:\ProgramData\chocolatey\bin\choco.exe install git -y + # Windows arm64 doesn't have git it seems or choco. + # We install choco and then git + # - name: Install Chocolatey + # if: matrix.settings.target == 'aarch64-pc-windows-msvc' + # shell: powershell + # run: | + # Set-ExecutionPolicy Bypass -Scope Process -Force + # [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + # iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + # - name: Add Chocolatey to PATH + # if: matrix.settings.target == 'aarch64-pc-windows-msvc' + # shell: powershell + # run: | + # $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" + # [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") + # Write-Host "Updated PATH: $env:PATH" + # - name: Install Git using Chocolatey + # if: matrix.settings.target == 'aarch64-pc-windows-msvc' + # shell: powershell + # run: | + # C:\ProgramData\chocolatey\bin\choco.exe install git -y - name: Add Git to PATH and verify installation + if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell run: | $gitPath = "C:\Program Files\Git\cmd" From 1da7e001b72a5026db9a139a29770454c7b3a1f5 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:42:31 +0100 Subject: [PATCH 22/36] add yarn and add back git install using choco --- .../workflows/release-node-bindings-ref.yml | 47 +++++++++++-------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 733910f4..917aef6a 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -125,26 +125,35 @@ jobs: steps: # Windows arm64 doesn't have git it seems or choco. # We install choco and then git - # - name: Install Chocolatey - # if: matrix.settings.target == 'aarch64-pc-windows-msvc' - # shell: powershell - # run: | - # Set-ExecutionPolicy Bypass -Scope Process -Force - # [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - # iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - # - name: Add Chocolatey to PATH - # if: matrix.settings.target == 'aarch64-pc-windows-msvc' - # shell: powershell - # run: | - # $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" - # [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") - # Write-Host "Updated PATH: $env:PATH" - # - name: Install Git using Chocolatey - # if: matrix.settings.target == 'aarch64-pc-windows-msvc' - # shell: powershell - # run: | - # C:\ProgramData\chocolatey\bin\choco.exe install git -y + - name: Install Chocolatey + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + shell: powershell + run: | + Set-ExecutionPolicy Bypass -Scope Process -Force + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + - name: Add Chocolatey to PATH + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + shell: powershell + run: | + $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" + [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") + Write-Host "Updated PATH: $env:PATH" + - name: Install Git using Chocolatey + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + shell: powershell + run: | + C:\ProgramData\chocolatey\bin\choco.exe install git -y + - name: Install Yarn + run: | + npm install -g yarn + echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Verify Yarn installation + run: | + yarn --version + - name: Add Git to PATH and verify installation if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell From 1d5af1c0cdab338c74dd37a12cecc563f92c7c39 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:48:54 +0100 Subject: [PATCH 23/36] add nodejs in choco --- .../workflows/release-node-bindings-ref.yml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 917aef6a..25f2f2c0 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -132,6 +132,7 @@ jobs: Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + - name: Add Chocolatey to PATH if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell @@ -139,6 +140,7 @@ jobs: $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") Write-Host "Updated PATH: $env:PATH" + - name: Install Git using Chocolatey if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell @@ -146,11 +148,13 @@ jobs: C:\ProgramData\chocolatey\bin\choco.exe install git -y - name: Install Yarn + if: matrix.settings.target == 'aarch64-pc-windows-msvc' run: | npm install -g yarn echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Verify Yarn installation + if: matrix.settings.target == 'aarch64-pc-windows-msvc' run: | yarn --version @@ -183,12 +187,24 @@ jobs: throw "Git not found at expected location: $gitPath" } - - - name: Verify Git installation + if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell run: | git --version + + - name: Install Node.js using Chocolatey + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + shell: powershell + run: | + choco install nodejs -y + + - name: Verify Node.js and npm installation + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + shell: powershell + run: | + node --version + npm --version - uses: actions/checkout@v4 with: @@ -197,9 +213,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + - name: Install dependencies run: yarn install working-directory: bindings/node + - name: Download artifacts uses: actions/download-artifact@v4 with: From b0d8476dbd7ee82103f4d51df4661ebec610a44b Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:52:32 +0100 Subject: [PATCH 24/36] install yarn after npm is installed --- .../workflows/release-node-bindings-ref.yml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 25f2f2c0..f1e294c7 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -147,17 +147,6 @@ jobs: run: | C:\ProgramData\chocolatey\bin\choco.exe install git -y - - name: Install Yarn - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - run: | - npm install -g yarn - echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Verify Yarn installation - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - run: | - yarn --version - - name: Add Git to PATH and verify installation if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell @@ -206,6 +195,17 @@ jobs: node --version npm --version + - name: Install Yarn + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + run: | + npm install -g yarn + echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Verify Yarn installation + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + run: | + yarn --version + - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} From 93d99a990a2c28608a7e7735af219488cfde7cb8 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 18:57:28 +0100 Subject: [PATCH 25/36] Try to use setup-node --- .../workflows/release-node-bindings-ref.yml | 43 +++---------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index f1e294c7..94354f57 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -148,33 +148,12 @@ jobs: C:\ProgramData\chocolatey\bin\choco.exe install git -y - name: Add Git to PATH and verify installation - if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell run: | $gitPath = "C:\Program Files\Git\cmd" - if (Test-Path (Join-Path $gitPath "git.exe")) { - Write-Host "Git found at: $gitPath" - - # Update PATH for current process - $env:Path = "$gitPath;$env:Path" - - # Update PATH for future processes in this job - echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - Write-Host "Updated PATH: $env:Path" - - # Verify Git is accessible - Write-Host "`nAttempting to run 'git --version':" - git --version - - if ($LASTEXITCODE -eq 0) { - Write-Host "Git successfully added to PATH and is working." - } else { - throw "Git command failed. Exit code: $LASTEXITCODE" - } - } else { - throw "Git not found at expected location: $gitPath" - } + $env:Path = "$gitPath;$env:Path" + echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + git --version - name: Verify Git installation if: matrix.settings.target == 'aarch64-pc-windows-msvc' @@ -182,18 +161,10 @@ jobs: run: | git --version - - name: Install Node.js using Chocolatey - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - shell: powershell - run: | - choco install nodejs -y - - - name: Verify Node.js and npm installation - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - shell: powershell - run: | - node --version - npm --version + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '22' - name: Install Yarn if: matrix.settings.target == 'aarch64-pc-windows-msvc' From a285694edff83add4f365822ed8432efa0b0b7c8 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 19:07:35 +0100 Subject: [PATCH 26/36] try using choc action --- .../workflows/release-node-bindings-ref.yml | 41 ++++++++----------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 94354f57..9b3003ec 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -123,6 +123,7 @@ jobs: name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} steps: + # Windows arm64 doesn't have git it seems or choco. # We install choco and then git - name: Install Chocolatey @@ -134,37 +135,31 @@ jobs: iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - name: Add Chocolatey to PATH - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - shell: powershell - run: | - $env:PATH = "C:\ProgramData\chocolatey\bin;$env:PATH" - [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") - Write-Host "Updated PATH: $env:PATH" - - - name: Install Git using Chocolatey - if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell run: | - C:\ProgramData\chocolatey\bin\choco.exe install git -y - - - name: Add Git to PATH and verify installation + $chocoPath = "C:\ProgramData\chocolatey\bin" + $env:Path = "$chocoPath;$env:Path" + echo "$chocoPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Verify Chocolatey installation shell: powershell - run: | - $gitPath = "C:\Program Files\Git\cmd" - $env:Path = "$gitPath;$env:Path" - echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - git --version - + run: choco --version + + - name: Install Git using Chocolatey Action + uses: crazy-max/ghaction-chocolatey@v2 + with: + args: install git -y + - name: Verify Git installation if: matrix.settings.target == 'aarch64-pc-windows-msvc' shell: powershell run: | git --version - - name: Setup Node.js - uses: actions/setup-node@v3 + - name: Setup node + uses: actions/setup-node@v4 with: - node-version: '22' + node-version: ${{ matrix.node }} - name: Install Yarn if: matrix.settings.target == 'aarch64-pc-windows-msvc' @@ -180,10 +175,6 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - name: Install dependencies run: yarn install From b2e2afc15efeb69b20578e873beb4e71b591931c Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 19:12:28 +0100 Subject: [PATCH 27/36] cleanup + refreshenv --- .github/workflows/release-node-bindings-ref.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 9b3003ec..08e376a1 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -127,7 +127,7 @@ jobs: # Windows arm64 doesn't have git it seems or choco. # We install choco and then git - name: Install Chocolatey - if: matrix.settings.target == 'aarch64-pc-windows-msvc' + if: matrix.settings.host == 'win-arm64' shell: powershell run: | Set-ExecutionPolicy Bypass -Scope Process -Force @@ -135,6 +135,7 @@ jobs: iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - name: Add Chocolatey to PATH + if: matrix.settings.host == 'win-arm64' shell: powershell run: | $chocoPath = "C:\ProgramData\chocolatey\bin" @@ -142,18 +143,21 @@ jobs: echo "$chocoPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Verify Chocolatey installation + if: matrix.settings.host == 'win-arm64' shell: powershell run: choco --version - name: Install Git using Chocolatey Action + if: matrix.settings.host == 'win-arm64' uses: crazy-max/ghaction-chocolatey@v2 with: args: install git -y - name: Verify Git installation - if: matrix.settings.target == 'aarch64-pc-windows-msvc' + if: matrix.settings.host == 'win-arm64' shell: powershell run: | + refreshenv git --version - name: Setup node @@ -162,13 +166,13 @@ jobs: node-version: ${{ matrix.node }} - name: Install Yarn - if: matrix.settings.target == 'aarch64-pc-windows-msvc' + if: matrix.settings.host == 'win-arm64' run: | npm install -g yarn echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Verify Yarn installation - if: matrix.settings.target == 'aarch64-pc-windows-msvc' + if: matrix.settings.host == 'win-arm64' run: | yarn --version From 422d0d3ddf8614bf4d95376154b36f13151bac50 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 19:17:54 +0100 Subject: [PATCH 28/36] Import-Module --- .github/workflows/release-node-bindings-ref.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index 08e376a1..a60c8920 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -157,6 +157,7 @@ jobs: if: matrix.settings.host == 'win-arm64' shell: powershell run: | + Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 refreshenv git --version From d4ab03a59b8385f436b2a8759f67ae9cd75943ac Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 19:33:50 +0100 Subject: [PATCH 29/36] add git to path again --- .github/workflows/release-node-bindings-ref.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index a60c8920..fceca13a 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -152,13 +152,14 @@ jobs: uses: crazy-max/ghaction-chocolatey@v2 with: args: install git -y - - - name: Verify Git installation + + - name: Add Git to PATH and verify installation if: matrix.settings.host == 'win-arm64' shell: powershell run: | - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 - refreshenv + $gitPath = "C:\Program Files\Git\cmd" + $env:Path = "$gitPath;$env:Path" + echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append git --version - name: Setup node From 6c48bffbca9271accd36e68446bdbc626a3916fa Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 19:40:38 +0100 Subject: [PATCH 30/36] restore other steps --- .../workflows/release-node-bindings-ref.yml | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml index fceca13a..87a0e20c 100644 --- a/.github/workflows/release-node-bindings-ref.yml +++ b/.github/workflows/release-node-bindings-ref.yml @@ -52,52 +52,52 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} - # - name: Setup node - # uses: actions/setup-node@v4 - # with: - # node-version: 20 - # - name: Install Rust toolchain - # uses: dtolnay/rust-toolchain@stable - # with: - # targets: ${{ matrix.settings.target }} - # # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) - # # Alternatively, you can install llvm - # - name: Install llvm-preview-tools - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: rustup component add llvm-tools-preview - # - name: Install dependencies - # run: yarn install - # working-directory: bindings/node - # - name: Setup Zig (Linux only) - # uses: goto-bus-stop/setup-zig@v2 - # with: - # version: 0.13.0 - # - name: Install cargo-zigbuild (Linux only) - # if: runner.os == 'Linux' - # run: cargo install cargo-zigbuild - # - name: Install cargo-xwin (Windows on Linux only) - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: cargo install cargo-xwin - # - name: Build (macOS) - # if: runner.os == 'macOS' - # run: | - # rustup target add ${{ matrix.settings.target }} - # yarn build --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Build (Linux) - # if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') - # run: yarn build --zig --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Build (Windows on Linux) - # if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - # run: yarn build --release --target ${{ matrix.settings.target }} - # working-directory: bindings/node - # - name: Upload artifact - # uses: actions/upload-artifact@v4 - # with: - # name: bindings-${{ matrix.settings.target }} - # path: bindings/node/${{ env.APP_NAME }}.*.node - # if-no-files-found: error + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.settings.target }} + # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) + # Alternatively, you can install llvm + - name: Install llvm-preview-tools + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: rustup component add llvm-tools-preview + - name: Install dependencies + run: yarn install + working-directory: bindings/node + - name: Setup Zig (Linux only) + uses: goto-bus-stop/setup-zig@v2 + with: + version: 0.13.0 + - name: Install cargo-zigbuild (Linux only) + if: runner.os == 'Linux' + run: cargo install cargo-zigbuild + - name: Install cargo-xwin (Windows on Linux only) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: cargo install cargo-xwin + - name: Build (macOS) + if: runner.os == 'macOS' + run: | + rustup target add ${{ matrix.settings.target }} + yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Linux) + if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') + run: yarn build --zig --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Windows on Linux) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.settings.target }} + path: bindings/node/${{ env.APP_NAME }}.*.node + if-no-files-found: error test: needs: build @@ -105,16 +105,16 @@ jobs: fail-fast: false matrix: settings: - # - host: macos-13 - # target: x86_64-apple-darwin - # - host: macos-14 - # target: aarch64-apple-darwin - # - host: ubuntu-latest - # target: x86_64-unknown-linux-gnu - # - host: linux-arm64 - # target: aarch64-unknown-linux-gnu - # - host: windows-latest - # target: x86_64-pc-windows-msvc + - host: macos-13 + target: x86_64-apple-darwin + - host: macos-14 + target: aarch64-apple-darwin + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: linux-arm64 + target: aarch64-unknown-linux-gnu + - host: windows-latest + target: x86_64-pc-windows-msvc - host: win-arm64 target: aarch64-pc-windows-msvc node: From d41fc1dbb03c889f01996380b47a82a4b541e06f Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 20:09:30 +0100 Subject: [PATCH 31/36] rename file --- .../workflows/release-node-bindings-ref.yml | 281 -------------- .github/workflows/release-node-bindings.yml | 360 +++++++++--------- 2 files changed, 182 insertions(+), 459 deletions(-) delete mode 100644 .github/workflows/release-node-bindings-ref.yml diff --git a/.github/workflows/release-node-bindings-ref.yml b/.github/workflows/release-node-bindings-ref.yml deleted file mode 100644 index 87a0e20c..00000000 --- a/.github/workflows/release-node-bindings-ref.yml +++ /dev/null @@ -1,281 +0,0 @@ -name: Node Napi Cross compile testing -env: - DEBUG: napi:* - APP_NAME: peerdas-kzg - MACOSX_DEPLOYMENT_TARGET: '10.13' -permissions: - contents: write - id-token: write - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - workflow_dispatch: - inputs: - ref: - description: The reference (branch/tag/commit) to checkout - required: true - release-type: - type: choice - required: false - default: none - description: Indicates whether we want to make a release and if which one - options: - - pre-release # Release a pre-release version to npm - - release # release an official version to npm - - none # Make no release - -jobs: - build: - strategy: - fail-fast: false - matrix: - settings: - # - host: macos-13 - # target: x86_64-apple-darwin - # - host: macos-14 - # target: aarch64-apple-darwin - # - host: ubuntu-latest - # target: x86_64-unknown-linux-gnu - # - host: ubuntu-latest - # target: aarch64-unknown-linux-gnu - # - host: ubuntu-latest - # target: x86_64-pc-windows-msvc - - host: ubuntu-latest - target: aarch64-pc-windows-msvc - - name: Build - ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.host }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.settings.target }} - # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) - # Alternatively, you can install llvm - - name: Install llvm-preview-tools - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: rustup component add llvm-tools-preview - - name: Install dependencies - run: yarn install - working-directory: bindings/node - - name: Setup Zig (Linux only) - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.13.0 - - name: Install cargo-zigbuild (Linux only) - if: runner.os == 'Linux' - run: cargo install cargo-zigbuild - - name: Install cargo-xwin (Windows on Linux only) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: cargo install cargo-xwin - - name: Build (macOS) - if: runner.os == 'macOS' - run: | - rustup target add ${{ matrix.settings.target }} - yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Linux) - if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') - run: yarn build --zig --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Build (Windows on Linux) - if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') - run: yarn build --release --target ${{ matrix.settings.target }} - working-directory: bindings/node - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: bindings-${{ matrix.settings.target }} - path: bindings/node/${{ env.APP_NAME }}.*.node - if-no-files-found: error - - test: - needs: build - strategy: - fail-fast: false - matrix: - settings: - - host: macos-13 - target: x86_64-apple-darwin - - host: macos-14 - target: aarch64-apple-darwin - - host: ubuntu-latest - target: x86_64-unknown-linux-gnu - - host: linux-arm64 - target: aarch64-unknown-linux-gnu - - host: windows-latest - target: x86_64-pc-windows-msvc - - host: win-arm64 - target: aarch64-pc-windows-msvc - node: - - '20' - - name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} - runs-on: ${{ matrix.settings.host }} - steps: - - # Windows arm64 doesn't have git it seems or choco. - # We install choco and then git - - name: Install Chocolatey - if: matrix.settings.host == 'win-arm64' - shell: powershell - run: | - Set-ExecutionPolicy Bypass -Scope Process -Force - [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 - iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) - - - name: Add Chocolatey to PATH - if: matrix.settings.host == 'win-arm64' - shell: powershell - run: | - $chocoPath = "C:\ProgramData\chocolatey\bin" - $env:Path = "$chocoPath;$env:Path" - echo "$chocoPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Verify Chocolatey installation - if: matrix.settings.host == 'win-arm64' - shell: powershell - run: choco --version - - - name: Install Git using Chocolatey Action - if: matrix.settings.host == 'win-arm64' - uses: crazy-max/ghaction-chocolatey@v2 - with: - args: install git -y - - - name: Add Git to PATH and verify installation - if: matrix.settings.host == 'win-arm64' - shell: powershell - run: | - $gitPath = "C:\Program Files\Git\cmd" - $env:Path = "$gitPath;$env:Path" - echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - git --version - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - - name: Install Yarn - if: matrix.settings.host == 'win-arm64' - run: | - npm install -g yarn - echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Verify Yarn installation - if: matrix.settings.host == 'win-arm64' - run: | - yarn --version - - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - - name: Install dependencies - run: yarn install - working-directory: bindings/node - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: bindings-${{ matrix.settings.target }} - path: bindings/node - - # Native testing for macOS (both Intel and ARM) - - name: Test bindings (macOS) - if: startsWith(matrix.settings.host, 'macos') - run: yarn test - working-directory: bindings/node - - # Native testing for x86_64 Linux - - name: Test bindings (Linux x86_64) - if: matrix.settings.target == 'x86_64-unknown-linux-gnu' - run: yarn test - working-directory: bindings/node - - - name: Test bindings (Linux ARM64) - if: matrix.settings.target == 'aarch64-unknown-linux-gnu' - run: yarn test - working-directory: bindings/node - - # Native testing for x86_64 Windows - - name: Test bindings (Windows x86_64) - if: matrix.settings.target == 'x86_64-pc-windows-msvc' - run: yarn test - working-directory: bindings/node - - # Native testing for arm64 Windows - - name: Test bindings (Windows arm64) - if: matrix.settings.target == 'aarch64-pc-windows-msvc' - run: yarn test - working-directory: bindings/node - - publish: - name: Publish - runs-on: ubuntu-latest - needs: - - test - defaults: - run: - working-directory: bindings/node - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: yarn - cache-dependency-path: 'bindings/node' - - name: Install dependencies - run: yarn install - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: bindings/node/artifacts - - name: Move artifacts - run: yarn artifacts - - name: Publish - if: ${{ inputs.release-type != 'none' }} - run: | - # TODO: We could remove the yarnpkg registry and set the npmregistry - # TODO: globally, by doing: yarn config set registry - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc - - if [ "${{inputs.release-type}}" = "release" ]; then - SHOULD_PUBLISH=true - elif [ "${{inputs.release-type}}" = "pre-release" ]; then - # Prepend the commit hash to the package.json files - # so we can publish a pre-release version - yarn prereleaseVersion - SHOULD_PUBLISH=true - else - echo "No release has been made" - SHOULD_PUBLISH=false - fi - - if [ "$SHOULD_PUBLISH" = true ]; then - # Prepare and publish the platform specific packages - yarn prepareAndPublishAddons - # Publish the base package, setting provenance - # to true as it's recommended. The platform specific packages - # don't need to have it, TODO but we could edit them to pass provenance. - npm config set provenance true - npm publish --access public - fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index dd68666a..87a0e20c 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -1,4 +1,4 @@ -name: Node Napi CI +name: Node Napi Cross compile testing env: DEBUG: napi:* APP_NAME: peerdas-kzg @@ -7,16 +7,25 @@ permissions: contents: write id-token: write -'on': +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: workflow_dispatch: inputs: ref: description: The reference (branch/tag/commit) to checkout required: true - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + release-type: + type: choice + required: false + default: none + description: Indicates whether we want to make a release and if which one + options: + - pre-release # Release a pre-release version to npm + - release # release an official version to npm + - none # Make no release jobs: build: @@ -24,229 +33,206 @@ jobs: fail-fast: false matrix: settings: - - host: macos-latest - target: x86_64-apple-darwin - build: yarn build --target x86_64-apple-darwin - - host: windows-latest - build: yarn build --target x86_64-pc-windows-msvc - target: x86_64-pc-windows-msvc - - host: ubuntu-latest - target: x86_64-unknown-linux-gnu - docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian - build: cd bindings/node && yarn build --target x86_64-unknown-linux-gnu - - host: macos-latest - target: aarch64-apple-darwin - build: yarn build --target aarch64-apple-darwin + # - host: macos-13 + # target: x86_64-apple-darwin + # - host: macos-14 + # target: aarch64-apple-darwin + # - host: ubuntu-latest + # target: x86_64-unknown-linux-gnu + # - host: ubuntu-latest + # target: aarch64-unknown-linux-gnu + # - host: ubuntu-latest + # target: x86_64-pc-windows-msvc - host: ubuntu-latest - target: aarch64-unknown-linux-gnu - docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 - build: cd bindings/node && yarn build --target aarch64-unknown-linux-gnu - name: stable - ${{ matrix.settings.target }} - node@20 + target: aarch64-pc-windows-msvc + + name: Build - ${{ matrix.settings.target }} runs-on: ${{ matrix.settings.host }} - defaults: - run: - working-directory: bindings/node steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.ref }} - - name: Move config.toml - run: | - # Move up two directories to the root of the workspace - cd ../.. - - mv .cargo/config.node.cross.toml .cargo/config.toml - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} + ref: ${{ inputs.ref }} - name: Setup node uses: actions/setup-node@v4 - if: ${{ !matrix.settings.docker }} with: node-version: 20 - cache: yarn - cache-dependency-path: 'bindings/node' - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - if: ${{ !matrix.settings.docker }} with: - toolchain: stable targets: ${{ matrix.settings.target }} - - name: Cache cargo - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - .cargo-cache - target/ - key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} - - uses: goto-bus-stop/setup-zig@v2 - if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }} - with: - version: 0.11.0 - - name: Setup toolchain - run: ${{ matrix.settings.setup }} - if: ${{ matrix.settings.setup }} - shell: bash - - name: Setup node x86 - if: matrix.settings.target == 'i686-pc-windows-msvc' - run: yarn config set supportedArchitectures.cpu "ia32" - shell: bash + # llvm-preview-tools are needed for xwin, because we are compiling assembly (blst) + # Alternatively, you can install llvm + - name: Install llvm-preview-tools + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: rustup component add llvm-tools-preview - name: Install dependencies run: yarn install - - name: Setup node x86 - uses: actions/setup-node@v4 - if: matrix.settings.target == 'i686-pc-windows-msvc' - with: - node-version: 20 - cache: yarn - cache-dependency-path: 'bindings/node' - architecture: x86 - - name: Build in docker - uses: addnab/docker-run-action@v3 - if: ${{ matrix.settings.docker }} + working-directory: bindings/node + - name: Setup Zig (Linux only) + uses: goto-bus-stop/setup-zig@v2 with: - image: ${{ matrix.settings.docker }} - options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build' - run: ${{ matrix.settings.build }} - - name: Build - run: ${{ matrix.settings.build }} - if: ${{ !matrix.settings.docker }} - shell: bash + version: 0.13.0 + - name: Install cargo-zigbuild (Linux only) + if: runner.os == 'Linux' + run: cargo install cargo-zigbuild + - name: Install cargo-xwin (Windows on Linux only) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: cargo install cargo-xwin + - name: Build (macOS) + if: runner.os == 'macOS' + run: | + rustup target add ${{ matrix.settings.target }} + yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Linux) + if: runner.os == 'Linux' && !contains(matrix.settings.target, 'windows') + run: yarn build --zig --release --target ${{ matrix.settings.target }} + working-directory: bindings/node + - name: Build (Windows on Linux) + if: runner.os == 'Linux' && contains(matrix.settings.target, 'windows') + run: yarn build --release --target ${{ matrix.settings.target }} + working-directory: bindings/node - name: Upload artifact uses: actions/upload-artifact@v4 with: name: bindings-${{ matrix.settings.target }} path: bindings/node/${{ env.APP_NAME }}.*.node if-no-files-found: error - test-macOS-windows-binding: - name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} - needs: - - build + + test: + needs: build strategy: fail-fast: false matrix: settings: - - host: macos-latest + - host: macos-13 target: x86_64-apple-darwin + - host: macos-14 + target: aarch64-apple-darwin + - host: ubuntu-latest + target: x86_64-unknown-linux-gnu + - host: linux-arm64 + target: aarch64-unknown-linux-gnu - host: windows-latest target: x86_64-pc-windows-msvc + - host: win-arm64 + target: aarch64-pc-windows-msvc node: - '20' + + name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} runs-on: ${{ matrix.settings.host }} - defaults: - run: - working-directory: bindings/node steps: - - uses: actions/checkout@v4 + + # Windows arm64 doesn't have git it seems or choco. + # We install choco and then git + - name: Install Chocolatey + if: matrix.settings.host == 'win-arm64' + shell: powershell + run: | + Set-ExecutionPolicy Bypass -Scope Process -Force + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + + - name: Add Chocolatey to PATH + if: matrix.settings.host == 'win-arm64' + shell: powershell + run: | + $chocoPath = "C:\ProgramData\chocolatey\bin" + $env:Path = "$chocoPath;$env:Path" + echo "$chocoPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Verify Chocolatey installation + if: matrix.settings.host == 'win-arm64' + shell: powershell + run: choco --version + + - name: Install Git using Chocolatey Action + if: matrix.settings.host == 'win-arm64' + uses: crazy-max/ghaction-chocolatey@v2 with: - ref: ${{ inputs.ref }} + args: install git -y + + - name: Add Git to PATH and verify installation + if: matrix.settings.host == 'win-arm64' + shell: powershell + run: | + $gitPath = "C:\Program Files\Git\cmd" + $env:Path = "$gitPath;$env:Path" + echo "$gitPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + git --version + - name: Setup node uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - cache: yarn - cache-dependency-path: 'bindings/node' - architecture: x64 + + - name: Install Yarn + if: matrix.settings.host == 'win-arm64' + run: | + npm install -g yarn + echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Verify Yarn installation + if: matrix.settings.host == 'win-arm64' + run: | + yarn --version + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + - name: Install dependencies run: yarn install + working-directory: bindings/node + - name: Download artifacts uses: actions/download-artifact@v4 with: name: bindings-${{ matrix.settings.target }} path: bindings/node - - name: Test bindings + + # Native testing for macOS (both Intel and ARM) + - name: Test bindings (macOS) + if: startsWith(matrix.settings.host, 'macos') run: yarn test - test-linux-x64-gnu-binding: - name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }} - needs: - - build - strategy: - fail-fast: false - matrix: - node: - - '20' - runs-on: ubuntu-latest - defaults: - run: working-directory: bindings/node - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: yarn - cache-dependency-path: 'bindings/node' - - name: Install dependencies - run: yarn install - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: bindings-x86_64-unknown-linux-gnu - path: bindings/node - - name: Test bindings - run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn test - test-linux-aarch64-gnu-binding: - name: Test bindings on aarch64-unknown-linux-gnu - node@${{ matrix.node }} - needs: - - build - strategy: - fail-fast: false - matrix: - node: - - '20' - runs-on: ubuntu-latest - defaults: - run: + + # Native testing for x86_64 Linux + - name: Test bindings (Linux x86_64) + if: matrix.settings.target == 'x86_64-unknown-linux-gnu' + run: yarn test working-directory: bindings/node - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.ref }} - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: bindings-aarch64-unknown-linux-gnu - path: bindings/node - - name: Install dependencies - run: | - yarn config set supportedArchitectures.cpu "arm64" - yarn config set supportedArchitectures.libc "glibc" - yarn install - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Setup and run tests - uses: addnab/docker-run-action@v3 - with: - image: node:${{ matrix.node }}-slim - options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' - run: | - cd bindings/node - set -e - yarn test - ls -la + + - name: Test bindings (Linux ARM64) + if: matrix.settings.target == 'aarch64-unknown-linux-gnu' + run: yarn test + working-directory: bindings/node + + # Native testing for x86_64 Windows + - name: Test bindings (Windows x86_64) + if: matrix.settings.target == 'x86_64-pc-windows-msvc' + run: yarn test + working-directory: bindings/node + + # Native testing for arm64 Windows + - name: Test bindings (Windows arm64) + if: matrix.settings.target == 'aarch64-pc-windows-msvc' + run: yarn test + working-directory: bindings/node + publish: name: Publish runs-on: ubuntu-latest needs: - - test-macOS-windows-binding - - test-linux-x64-gnu-binding - - test-linux-aarch64-gnu-binding + - test defaults: run: working-directory: bindings/node steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.ref }} + ref: ${{ inputs.ref }} - name: Setup node uses: actions/setup-node@v4 with: @@ -258,19 +244,37 @@ jobs: - name: Download all artifacts uses: actions/download-artifact@v4 with: - path: artifacts + path: bindings/node/artifacts - name: Move artifacts run: yarn artifacts - name: Publish + if: ${{ inputs.release-type != 'none' }} run: | - npm config set provenance true + # TODO: We could remove the yarnpkg registry and set the npmregistry + # TODO: globally, by doing: yarn config set registry echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - if [[ ${{ inputs.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - npm publish --access public - elif [[ ${{ inputs.ref }} =~ ^[a-zA-Z0-9_-]+$ ]]; then - npm publish --tag next --access public + echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc + + if [ "${{inputs.release-type}}" = "release" ]; then + SHOULD_PUBLISH=true + elif [ "${{inputs.release-type}}" = "pre-release" ]; then + # Prepend the commit hash to the package.json files + # so we can publish a pre-release version + yarn prereleaseVersion + SHOULD_PUBLISH=true else - echo "Invalid ref format. Skipping publish." + echo "No release has been made" + SHOULD_PUBLISH=false + fi + + if [ "$SHOULD_PUBLISH" = true ]; then + # Prepare and publish the platform specific packages + yarn prepareAndPublishAddons + # Publish the base package, setting provenance + # to true as it's recommended. The platform specific packages + # don't need to have it, TODO but we could edit them to pass provenance. + npm config set provenance true + npm publish --access public fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 38ae3074c14e21e82d782a57d14d202b903de4ab Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 20:10:53 +0100 Subject: [PATCH 32/36] list files --- .github/workflows/release-node-bindings.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index 87a0e20c..6bdcd26d 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -192,6 +192,9 @@ jobs: name: bindings-${{ matrix.settings.target }} path: bindings/node + - name: List files + run: ls -laR + # Native testing for macOS (both Intel and ARM) - name: Test bindings (macOS) if: startsWith(matrix.settings.host, 'macos') From ae723353febb1919a034e67e4a1861c0b8a51390 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 20:12:53 +0100 Subject: [PATCH 33/36] remove cache --- .github/workflows/release-node-bindings.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index 6bdcd26d..43b1b701 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -240,8 +240,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20 - cache: yarn - cache-dependency-path: 'bindings/node' - name: Install dependencies run: yarn install - name: Download all artifacts From 06cbeb8ecbb10c39b991a245515c194bf40830e0 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 20:20:49 +0100 Subject: [PATCH 34/36] set shell as bash (should use git bash) --- .github/workflows/release-node-bindings.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index 43b1b701..72bbf656 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -172,12 +172,12 @@ jobs: run: | npm install -g yarn echo "$(npm config get prefix)/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - + - name: Verify Yarn installation if: matrix.settings.host == 'win-arm64' run: | yarn --version - + - uses: actions/checkout@v4 with: ref: ${{ inputs.ref }} @@ -191,9 +191,10 @@ jobs: with: name: bindings-${{ matrix.settings.target }} path: bindings/node - + - name: List files run: ls -laR + shell: bash # Native testing for macOS (both Intel and ARM) - name: Test bindings (macOS) From 930fa104da2f8dc14b0d5e0739cf8c143cff67e7 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 20:37:35 +0100 Subject: [PATCH 35/36] use pwsh (git bash not working) --- .github/workflows/release-node-bindings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index 72bbf656..aad24b49 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -193,8 +193,8 @@ jobs: path: bindings/node - name: List files - run: ls -laR - shell: bash + run: Get-ChildItem -Force -Recurse | Select-Object Mode, LastWriteTime, Length, FullName + shell: powershell # Native testing for macOS (both Intel and ARM) - name: Test bindings (macOS) From 33883cc60be34759d33b185de3e3ecb4090cd255 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Sun, 30 Jun 2024 21:10:52 +0100 Subject: [PATCH 36/36] ad diagnostic information --- .github/workflows/release-node-bindings.yml | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/release-node-bindings.yml b/.github/workflows/release-node-bindings.yml index aad24b49..d59d1391 100644 --- a/.github/workflows/release-node-bindings.yml +++ b/.github/workflows/release-node-bindings.yml @@ -196,6 +196,30 @@ jobs: run: Get-ChildItem -Force -Recurse | Select-Object Mode, LastWriteTime, Length, FullName shell: powershell + - name: Diagnostic Information + shell: pwsh + run: | + Write-Host "Node.js version and architecture:" + node -p "process.arch + ' ' + process.version" + + Write-Host "`nNODE_MODULE_VERSION:" + node -p "process.versions.modules" + + Write-Host "`nSystem Type:" + systeminfo | findstr "System Type" + + Write-Host "`nDirectory contents:" + Get-ChildItem -Force -Recurse .\bindings\node | Select-Object FullName, Length, LastWriteTime + + Write-Host "`nFile details:" + Get-Item .\bindings\node\peerdas-kzg.win32-arm64-msvc.node | Select-Object * + + Write-Host "`nTrying to load the module in Node.js REPL:" + node -e "try { require('./bindings/node/peerdas-kzg.win32-arm64-msvc.node'); console.log('Module loaded successfully'); } catch (error) { console.error('Error loading module:', error.message); }" + + Write-Host "`nChecking for missing DLLs:" + Get-Content .\bindings\node\peerdas-kzg.win32-arm64-msvc.node | Select-String -Pattern "\.dll" -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value } | Sort-Object -Unique + # Native testing for macOS (both Intel and ARM) - name: Test bindings (macOS) if: startsWith(matrix.settings.host, 'macos')