Skip to content

Commit

Permalink
ci: update node-gyp (#632)
Browse files Browse the repository at this point in the history
* ci: nodejs 16 -> 18

* ci: ubuntu 18.04 -> 20.04

* ci: update gh actions

* ci: update node-gyp

* ci: test on node 16 also
  • Loading branch information
rithvikvibhu authored Jun 18, 2023
1 parent 33f7431 commit 429e180
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
node-version: ['16']
node-version: ['16', '18']

# OS-specific commands/variables
include:
Expand All @@ -29,13 +29,23 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# https://github.com/actions/setup-node/issues/280#issuecomment-1139455898
- name: Update node-gyp (windows only)
if: startsWith(matrix.os, 'windows')
run: |
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
$NodeDirPath = Split-Path $WhereNode -Parent
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\@npmcli\run-script"
cd $NodeModulesPath
npm install node-gyp@latest
- name: Install dependencies (linux only)
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-18.04, macos-latest]
os: [windows-latest, ubuntu-20.04, macos-latest]

# OS-specific commands/variables
include:
- os: ubuntu-18.04
- os: ubuntu-20.04
cmd_package: npm run package-linux
out_filename: Bob-linux
- os: windows-latest
Expand All @@ -30,23 +30,28 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js 16.x
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "npm"

# https://github.com/actions/setup-node/issues/280#issuecomment-1139455898
- name: Update node-gyp (windows only)
if: startsWith(matrix.os, 'windows')
run: |
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition
$NodeDirPath = Split-Path $WhereNode -Parent
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\@npmcli\run-script"
cd $NodeModulesPath
npm install node-gyp@latest
- name: Install dependencies (linux only)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y

- name: Install npm packages
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
retry_on: error
command: npm i
run: npm i

- name: Install dmg-license (macos only)
if: startsWith(matrix.os, 'macos')
Expand Down

0 comments on commit 429e180

Please sign in to comment.