Skip to content

Build

Build #116

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
electron:
description: 'Electron version to build for'
required: true
default: '40'
type: choice
options:
- '36'
- '37'
- '38'
- '39'
- '40'
- '41'
workflow_call:
inputs:
electron:
description: 'Electron version to build for'
required: true
type: string
build-all:
description: 'Building for all versions?'
required: true
default: false
type: boolean
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
jobs:
test-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.test-matrix.outputs.matrix }}
name: test-os-matrix
steps:
- name: Test versions
shell: bash
id: test-matrix
run: |
echo "::notice::Starting build for Electron ${{ inputs.electron }}"
echo "matrix={'include':[{\"name\":\"test-win-x64\",\"os\":\"windows-2025\",\"platform\":\"win\"},{\"name\":\"test-win-arm64\",\"os\":\"windows-11-arm\",\"platform\":\"win\"},{\"name\":\"test-darwin-x64\",\"os\":\"macos-15-intel\",\"platform\":\"darwin\"},{\"name\":\"test-darwin-arm64\",\"os\":\"macos-15\",\"platform\":\"darwin\"}]}" >> $GITHUB_OUTPUT
electron-version:
runs-on: ubuntu-latest
outputs:
test-version: ${{ steps.electron-test-version.outputs.test-version }}
name: test-version-electron-${{ inputs.electron }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
cache-dependency-path: package-lock.json
# - name: npm install
# shell: bash
# run: npm i
# env:
# DOTNET_CLI_TELEMETRY_OPTOUT: 1
# DOTNET_NOLOGO: 1
- name: Get latest Electron version for ${{ inputs.electron }}
id: electron-test-version
shell: bash
run: |
node tools/getVersion.js ${{ inputs.electron }}
echo "test-version=$(cat electron.txt)" >> $GITHUB_OUTPUT
echo "::notice::Using Electron version $(cat electron.txt) for Electron ${{ inputs.electron }}"
build-win-x86:
uses: ./.github/workflows/build-edge.yml
with:
electron: ${{ inputs.electron }}
os: windows-2025
platform: win
arch: ia32
build-win-x64:
uses: ./.github/workflows/build-edge.yml
with:
electron: ${{ inputs.electron }}
os: windows-2025
platform: win
arch: x64
build-win-arm64:
uses: ./.github/workflows/build-edge.yml
with:
electron: ${{ inputs.electron }}
os: windows-2025
platform: win
arch: arm64
build-darwin-x64:
uses: ./.github/workflows/build-edge.yml
with:
electron: ${{ inputs.electron }}
os: macos-15-intel
platform: darwin
arch: x64
build-darwin-arm64:
uses: ./.github/workflows/build-edge.yml
with:
electron: ${{ inputs.electron }}
os: macos-15
platform: darwin
arch: arm64
test:
uses: ./.github/workflows/build-test.yml
with:
electron: ${{ needs.electron-version.outputs.test-version }}
version: ${{ inputs.electron }}
os: ${{ matrix.os }}
platform: ${{ matrix.platform }}
name: ${{ matrix.name }}
needs: [electron-version, test-matrix, build-win-x86, build-win-x64, build-win-arm64, build-darwin-x64, build-darwin-arm64]
strategy:
matrix: ${{ fromJSON(needs.test-matrix.outputs.matrix) }}
fail-fast: false
name: ${{ matrix.name }}
upload-artifacts:
if: ${{ inputs.build-all == false && success() }}
runs-on: ubuntu-latest
needs: [test]
name: upload-artifacts
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release
pattern: '*-electron-edge-js-*-${{ inputs.electron }}'
- name: Upload artifacts
uses: actions/upload-artifact/merge@v4
if: success()
with:
name: electron-edge-js-${{ inputs.electron }}
pattern: '*electron-edge-js*'
delete-merged: true