Check ABI for Electron Version #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check ABI for Electron Version | |
on: | |
workflow_dispatch: | |
inputs: | |
electron-version: | |
type: string | |
description: Electron version to check (e.g. 26.0.0) | |
required: true | |
expected-abi: | |
type: string | |
description: Expected ABI number (e.g. 117) | |
required: true | |
permissions: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Node.js | |
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # tag: v4.0.0 | |
with: | |
node-version: lts/* | |
- name: Create a Temporary package.json | |
run: npm init --yes | |
- name: Install latest node-abi | |
run: npm install --save-dev node-abi | |
- name: Check ABI for Electron version | |
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 | |
with: | |
script: | | |
const nodeAbi = require('node-abi'); | |
const abi = nodeAbi.getAbi('${{ github.event.inputs.electron-version }}', 'electron'); | |
if (abi !== ${{ github.event.inputs.expected-abi }}) { | |
core.error(`Got ABI ${abi}, expected ${{ github.event.inputs.expected-abi }}`); | |
process.exitCode = 1; | |
} else { | |
core.info(`Got expected ABI ${abi}`); | |
} |