From 429e18025f1c813edcdceb00237e7785b81ba944 Mon Sep 17 00:00:00 2001 From: Rithvik Vibhu Date: Sun, 18 Jun 2023 11:31:18 +0530 Subject: [PATCH] ci: update node-gyp (#632) * ci: nodejs 16 -> 18 * ci: ubuntu 18.04 -> 20.04 * ci: update gh actions * ci: update node-gyp * ci: test on node 16 also --- .github/workflows/build-and-test.yml | 18 ++++++++++++++---- .github/workflows/package.yml | 25 +++++++++++++++---------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 21c2c3eea..f050e274d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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: @@ -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 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 32378c5be..aeae24989 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -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 @@ -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')