-
Notifications
You must be signed in to change notification settings - Fork 61
42 lines (37 loc) · 1.28 KB
/
check-electron-abi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { getAbi } = await import('${{ github.workspace }}/node_modules/node-abi/index.js');
const abi = 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}`);
}