From 1f23c7af729245a660bd01b61f5a43566ef87952 Mon Sep 17 00:00:00 2001 From: agracio Date: Sun, 27 Oct 2024 18:15:43 +0000 Subject: [PATCH] updating workflows --- .github/actions/build/action.yml | 33 ++++++++++++++++++++++++++++++++ .github/workflows/build-all.yml | 17 +++++++++------- .github/workflows/build.yml | 9 ++++++--- .github/workflows/main.yml | 2 ++ .gitignore | 2 +- 5 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 .github/actions/build/action.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..47e2208 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,33 @@ +name: 'Build Windows binaries' +description: 'Build Windows binaries' +inputs: + electron: + description: 'Electron version' + required: true + arch: + description: 'Target arch' + required: true + +runs: + using: "composite" + steps: + + - name: Build ${{ inputs.arch }} + shell: pwsh + run: | + node-gyp configure --target=${{ inputs.electron }}.0.0 --disturl=https://electronjs.org/headers --runtime=electron --release --arch=${{ inputs.arch }} + + if ( '${{ inputs.arch }}' -eq 'arm64'){ + (Get-Content -Raw build/build_managed.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/build_managed.vcxproj + (Get-Content -Raw build/edge_coreclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_coreclr.vcxproj + (Get-Content -Raw build/edge_nativeclr.vcxproj) -replace 'Strict', '' | Out-File -Encoding Utf8 build/edge_nativeclr.vcxproj + } + if ( '${{ inputs.electron }}' -ge 32 -And '${{ inputs.arch }}' -eq 'arm64'){ + (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\${{ inputs.arch }}\${{ inputs.electron }}.0.0 + cmd /c rmdir /S /Q build diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index c7e8bcf..3188a9c 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -58,22 +58,25 @@ jobs: - name: Build ia32 timeout-minutes: 30 - uses: ./.github/actions/build-ia32 + uses: ./.github/actions/build with: - electron: ${{ matrix.electron }} + electron: ${{ inputs.build-version }} + arch: 'ia32' - name: Build x64 timeout-minutes: 30 - uses: ./.github/actions/build-x64 + uses: ./.github/actions/build with: - electron: ${{ matrix.electron }} + electron: ${{ inputs.build-version }} + arch: 'x64' - name: Build arm64 timeout-minutes: 30 - uses: ./.github/actions/build-arm64 + uses: ./.github/actions/build with: - electron: ${{ matrix.electron }} - + electron: ${{ inputs.build-version }} + arch: 'arm64' + - name: Upload artifacts uses: actions/upload-artifact@v4 if: success() diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 291bed3..81f4b1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,21 +78,24 @@ jobs: - name: Build ia32 timeout-minutes: 30 - uses: ./.github/actions/build-ia32 + uses: ./.github/actions/build with: electron: ${{ inputs.build-version }} + arch: 'ia32' - name: Build x64 timeout-minutes: 30 - uses: ./.github/actions/build-x64 + uses: ./.github/actions/build with: electron: ${{ inputs.build-version }} + arch: 'x64' - name: Build arm64 timeout-minutes: 30 - uses: ./.github/actions/build-arm64 + uses: ./.github/actions/build with: electron: ${{ inputs.build-version }} + arch: 'arm64' - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e830b8..14bc4db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,7 @@ on: - '.github/FUNDING.YML' - '.github/workflows/build.yml' - '.github/workflows/build*.yml' + - '.github/actions/test-build/action.yml' - '.github/actions/build*/*.*' - '**/*.md' - '**/*.d.ts' @@ -42,6 +43,7 @@ on: - '.github/FUNDING.YML' - '.github/workflows/build.yml' - '.github/workflows/build*.yml' + - '.github/actions/test-build/action.yml' - '.github/actions/build*/*.*' - '**/*.md' - '**/*.d.ts' diff --git a/.gitignore b/.gitignore index 1c06c54..117ef77 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ results node_modules npm-debug.log -build +/build bin/ obj/