diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 988c628..fb048de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,22 +3,19 @@ name: Build on: workflow_dispatch: - # node-gyp configure build --target=31.6.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64 - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC DOTNET_CLI_TELEMETRY_OPTOUT: 1 jobs: build: - runs-on: ${{ matrix.os }} + runs-on: windows-2022 strategy: fail-fast: false matrix: - os: [windows-2022] electron: [29.4.6, 30.5.1, 31.6.0] - name: build-${{ matrix.os }}-v${{ matrix.electron }} + name: build Electron-${{ matrix.electron }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -37,7 +34,7 @@ jobs: cache-name: cache-node-modules with: path: node_modules - key: ${{ matrix.os }}-${{ matrix.electron }}-${{ hashFiles('package-lock.json') }} + key: ${{ matrix.electron }}-${{ hashFiles('package-lock.json') }} - name: Setup dotnet uses: actions/setup-dotnet@v4 @@ -48,6 +45,11 @@ jobs: run: | node -v && npm -v && dotnet --version && node -p process.platform && node -p process.arch + - name: setup electron version + shell: bash + run: | + sed -i -e 's/"electron": "=31.6.0"/"electron": "=${{ matrix.electron }}"/g' package.json + - name: npm install run: | npm i @@ -55,16 +57,26 @@ jobs: env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 + - uses: bhowell2/github-substring-action@1.0.2 + id: electron_version + with: + value: "${{ matrix.electron }}" + length_from_start: 2 + - name: Create release folder run: | mkdir "release\ia32\${{ matrix.electron }}" mkdir "release\x64\${{ matrix.electron }}" mkdir "release\arm64\${{ matrix.electron }}" + 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: Build is32 + - name: Build ia32 timeout-minutes: 30 run: | node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32 + cmd /c copy /y build\Release\edge_*.node lib\native\win32\ia32\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\ia32\${{ matrix.electron }} cmd /c rmdir /S /Q build @@ -72,6 +84,7 @@ jobs: timeout-minutes: 30 run: | node-gyp configure build --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64 + cmd /c copy /y build\Release\edge_*.node lib\native\win32\x64\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\x64\${{ matrix.electron }} cmd /c rmdir /S /Q build @@ -86,7 +99,7 @@ jobs: (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj node-gyp build - + cmd /c copy /y build\Release\edge_*.node lib\native\win32\arm64\${{ steps.electron_version.outputs.substring }}.0.0 cmd /c copy /y build\Release\edge_*.node release\arm64\${{ matrix.electron }} cmd /c rmdir /S /Q build @@ -95,7 +108,10 @@ jobs: uses: actions/upload-artifact@v4.3.3 if: success() with: - name: ${{ matrix.os }}-${{ matrix.electron }} + name: ${{ matrix.electron }} path: | release - + + test: + needs: build + runs-on: windows-2022 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d23d8bf..5eae1c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ on: - 'stress/*' - 'performance/*' - '.github/FUNDING.YML' - - '.github/build.yml' + - '.github/workflows/build.yml' - '**/*.md' - '**/*.d.ts' - '**/*.bat'