Skip to content

Commit

Permalink
updating GitHub pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Sep 18, 2024
1 parent 41e9b9b commit 127e1bf
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ name: Build

on:
workflow_dispatch:
inputs:
build-version:
description: 'Electron version to build'
required: true
default: '31.0.0'
type: choice
options:
- 29.0.0
- 30.0.0
- 31.0.0
test-version:
description: 'Electron version to test build'
required: true
default: '31.6.0'
type: choice
options:
- 29.4.6
- 30.5.1
- 31.6.0

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # required to setup CSC
Expand All @@ -12,13 +31,13 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# fail-fast: false
matrix:
electron: [29.0.0, 30.0.0, 31.0.0]
# electron: [29.0.0, 30.0.0, 31.0.0]
# electron: [29.0.0]
os: [windows-2022]

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

- name: Checkout code
Expand All @@ -27,57 +46,58 @@ jobs:
- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: ${{ matrix.electron }}
electron: ${{ inputs.build-version }}
os: ${{ matrix.os }}

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

- uses: agracio/[email protected]
id: electron_version
with:
value: "${{ matrix.electron }}"
value: "${{ inputs.build-version }}"
length_from_start: 2

- name: Create release folder
run: |
mkdir "release\ia32\${{ matrix.electron }}"
mkdir "release\x64\${{ matrix.electron }}"
mkdir "release\arm64\${{ matrix.electron }}"
mkdir "release\ia32\${{ inputs.build-version }}"
mkdir "release\x64\${{ inputs.build-version }}"
mkdir "release\arm64\${{ inputs.build-version }}"
- 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 release\ia32\${{ matrix.electron }}
node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=ia32
cmd /c copy /y build\Release\edge_*.node release\ia32\${{ inputs.build-version }}
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 release\x64\${{ matrix.electron }}
node-gyp configure build --target=${{ inputs.build-version }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=x64
cmd /c copy /y build\Release\edge_*.node release\x64\${{ inputs.build-version }}
cmd /c rmdir /S /Q build
- name: Build arm64
timeout-minutes: 30
shell: pwsh
run: |
node-gyp configure --target=${{ matrix.electron }} --disturl=https://electronjs.org/headers --runtime=electron --release --arch=arm64
node-gyp configure --target=${{ inputs.build-version }} --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
node-gyp build
cmd /c copy /y build\Release\edge_*.node release\arm64\${{ matrix.electron }}
cmd /c copy /y build\Release\edge_*.node release\arm64\${{ inputs.build-version }}
cmd /c rmdir /S /Q build
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: ${{ matrix.electron }}
name: ${{ inputs.build-version }}
path: |
release
Expand All @@ -86,26 +106,27 @@ jobs:
needs: build
strategy:
matrix:
electron: [29.4.6, 30.5.1, 31.6.0]
# electron: [29.4.6, 30.5.1, 31.6.0]
# electron: [29.4.6]
os: [windows-2022]
fail-fast: false
# fail-fast: false

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

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

- uses: agracio/[email protected]
id: electron_version
with:
value: ${{ matrix.electron }}
value: ${{ inputs.test-version }}
length_from_start: 2

- name: Create release folder
Expand All @@ -130,12 +151,12 @@ jobs:
timeout-minutes: 10
uses: ./.github/actions/test-windows
with:
electron: ${{ matrix.electron }}
electron: ${{ inputs.test-version }}

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

Expand Down

0 comments on commit 127e1bf

Please sign in to comment.