Skip to content

Commit

Permalink
updating Windows native binaries, updating workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Oct 25, 2024
1 parent 8d46b4d commit cfe71d9
Show file tree
Hide file tree
Showing 37 changed files with 236 additions and 47 deletions.
29 changes: 29 additions & 0 deletions .github/actions/build-arm64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Build Windows arm64'
description: 'Build Windows arm64 binaries'
inputs:
electron:
description: 'Electron version'
required: true

runs:
using: "composite"
steps:

- name: Build arm64
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.electron }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64
(Get-Content -Raw build/build_managed.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
if ( '${{ inputs.electron }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\arm64\${{ inputs.electron }}.0.0
cmd /c rmdir /S /Q build
25 changes: 25 additions & 0 deletions .github/actions/build-ia32/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Build Windows ia32'
description: 'Build Windows ia32 binaries'
inputs:
electron:
description: 'Electron version'
required: true

runs:
using: "composite"
steps:

- name: Build ia32
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.electron }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32
if ( '${{ inputs.electron }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\ia32\${{ inputs.electron }}.0.0
cmd /c rmdir /S /Q build
25 changes: 25 additions & 0 deletions .github/actions/build-x64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Build Windows x64'
description: 'Build Windows x64 binaries'
inputs:
electron:
description: 'Electron version'
required: true

runs:
using: "composite"
steps:

- name: Build x64
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.electron }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64
if ( '${{ inputs.electron }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\x64\${{ inputs.electron }}.0.0
cmd /c rmdir /S /Q build
2 changes: 1 addition & 1 deletion .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
node:
description: 'Node.js version'
required: false
default: '20'
default: '22'
os:
description: 'runs-on'
required: false
Expand Down
143 changes: 143 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Build All

on:
workflow_dispatch:

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1

jobs:
build:
runs-on: ${{ matrix.os }}
outputs:
test-version: ${{ steps.electron-test-version.outputs.test-version }}
strategy:
# fail-fast: false
matrix:
electron: [29, 30, 31, 32, 33]
os: [windows-2022]

name: build ${{ matrix.os }}-v${{ matrix.electron }}
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Resolve Electron version for test
id: electron-test-version
shell: bash
run: |
if [[ ${{ matrix.electron }} == '29' ]]; then
echo "test-version=29.4.6" >> $GITHUB_OUTPUT
elif [[ ${{ matrix.electron }} == '30' ]]; then
echo "test-version=30.5.1" >> $GITHUB_OUTPUT
elif [[ ${{ matrix.electron }} == '31' ]]; then
echo "test-version=31.7.2" >> $GITHUB_OUTPUT
elif [[ ${{ matrix.electron }} == '32' ]]; then
echo "test-version=32.2.2" >> $GITHUB_OUTPUT
elif [[ ${{ matrix.electron }} == '33' ]]; then
echo "test-version=33.0.2" >> $GITHUB_OUTPUT
fi
- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: '${{ matrix.electron }}.0.0'
os: ${{ matrix.os }}

- name: install node-gyp
run: npm i -g node-gyp

- name: Create release folder
run: |
mkdir "release\ia32\${{ matrix.electron }}.0.0"
mkdir "release\x64\${{ matrix.electron }}.0.0"
mkdir "release\arm64\${{ matrix.electron }}.0.0"
- name: Build ia32
timeout-minutes: 30
uses: ./.github/actions/build-ia32
with:
electron: ${{ matrix.electron }}

- name: Build x64
timeout-minutes: 30
uses: ./.github/actions/build-x64
with:
electron: ${{ matrix.electron }}

- name: Build arm64
timeout-minutes: 30
uses: ./.github/actions/build-arm64
with:
electron: ${{ matrix.electron }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: electron-edge-js-${{ matrix.electron }}.0.0
path: |
release
test:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [windows-2022]
# fail-fast: false

name: test ${{ matrix.os }}-v${{ needs.build.outputs.test-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: ${{ needs.build.outputs.test-version }}
os: ${{ matrix.os }}
replace-version: true

- uses: agracio/[email protected]
id: electron_version
with:
value: ${{ needs.build.outputs.test-version }}
length_from_start: 2

- name: Create release folder
run: |
cmd /c if not exist "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0"
cmd /c if not exist "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0"
cmd /c if not exist "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0" mkdir "lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release
pattern: electron-edge-js-${{ steps.electron_version.outputs.substring }}.0.0*

- run: ls -R release

- name: Copy artifacts
run: |
cmd /c copy /y release\electron-edge-js-${{ steps.electron_version.outputs.substring }}.0.0\x64\${{ steps.electron_version.outputs.substring }}.0.0\edge_*.node lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0
- name: Test
timeout-minutes: 10
uses: ./.github/actions/test-windows
with:
electron: ${{ needs.build.outputs.test-version }}

- name: Test report
uses: ./.github/actions/create-test-report
with:
electron: ${{ needs.build.outputs.test-version }}
os: ${{ matrix.os }}
name: 'build-tests'


55 changes: 9 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
strategy:
# fail-fast: false
matrix:
# electron: [29.0.0, 30.0.0, 31.0.0]
# electron: [29.0.0]
os: [windows-2022]

name: build ${{ matrix.os }}-v${{ inputs.build-version }}
Expand Down Expand Up @@ -81,56 +79,21 @@ jobs:
- name: Build ia32
timeout-minutes: 30
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.build-version }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32
if ( '${{ inputs.build-version }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\ia32\${{ inputs.build-version }}.0.0
cmd /c rmdir /S /Q build
uses: ./.github/actions/build-ia32
with:
electron: ${{ inputs.build-version }}

- name: Build x64
timeout-minutes: 30
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.build-version }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64
if ( '${{ inputs.build-version }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\x64\${{ inputs.build-version }}.0.0
cmd /c rmdir /S /Q build
uses: ./.github/actions/build-x64
with:
electron: ${{ inputs.build-version }}

- name: Build arm64
timeout-minutes: 30
shell: pwsh
run: |
node-gyp configure --target=${{ inputs.build-version }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64
(Get-Content -Raw build/build_managed.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
if ( '${{ inputs.build-version }}' -ge 32){
(Get-Content -Raw build/build_managed.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/build_managed.vcxproj
(Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'std:c\+\+17', 'std:c++20' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj
}
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\arm64\${{ inputs.build-version }}.0.0
cmd /c rmdir /S /Q build
uses: ./.github/actions/build-arm64
with:
electron: ${{ inputs.build-version }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- 'performance/*'
- '.github/FUNDING.YML'
- '.github/workflows/build.yml'
- '.github/workflows/build*.yml'
- '.github/actions/build*/*.*'
- '**/*.md'
- '**/*.d.ts'
- '**/*.bat'
Expand Down Expand Up @@ -39,6 +41,8 @@ on:
- 'performance/*'
- '.github/FUNDING.YML'
- '.github/workflows/build.yml'
- '.github/workflows/build*.yml'
- '.github/actions/build*/*.*'
- '**/*.md'
- '**/*.d.ts'
- '**/*.bat'
Expand Down
Binary file modified lib/native/win32/arm64/29.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/29.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/30.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/30.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/31.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/31.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/32.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/32.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/33.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/arm64/33.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/29.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/29.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/30.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/30.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/31.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/31.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/32.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/32.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/33.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/33.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/29.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/29.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/30.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/30.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/31.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/31.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/32.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/32.0.0/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/33.0.0/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/33.0.0/edge_nativeclr.node
Binary file not shown.

0 comments on commit cfe71d9

Please sign in to comment.