Skip to content

Commit

Permalink
updating GitHub CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Sep 15, 2024
1 parent 6e517f8 commit bb81ae8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -48,30 +45,46 @@ 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
npm i -g node-gyp
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
- name: Build x64
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
Expand All @@ -86,7 +99,7 @@ jobs:
(Get-Content -Raw build/edge_nativeclr.vcxproj) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | 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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'stress/*'
- 'performance/*'
- '.github/FUNDING.YML'
- '.github/build.yml'
- '.github/workflows/build.yml'
- '**/*.md'
- '**/*.d.ts'
- '**/*.bat'
Expand Down

0 comments on commit bb81ae8

Please sign in to comment.