Skip to content

Commit

Permalink
feat: build binaries with node@16
Browse files Browse the repository at this point in the history
Need to also default to node@16 and npm@8 in dev/ci as dependencies may contain native modules (.node) which need to be installed using the same node version for compatibilty in binaries.
  • Loading branch information
Jahed Ahmed committed Jan 4, 2022
1 parent 3b414bb commit 618a721
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
28 changes: 18 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ orbs:
gh: circleci/github-cli@1.0.4

defaults: &defaults
working_directory: /mnt/ramdisk/snyk
parameters:
node_version:
type: string
default: '14.17.5'
default: '16.13.1'
npm_version:
type: string
default: '8.1.2'
root_tap_tests:
type: boolean
default: false
Expand All @@ -25,7 +29,6 @@ defaults: &defaults
package_tests:
type: boolean
default: false
working_directory: /mnt/ramdisk/snyk

commands:
install_project_dependencies:
Expand All @@ -34,7 +37,6 @@ commands:
type: string
npm_version:
type: string
default: '7.21.1'
npm_cache_directory:
type: string
default: /mnt/ramdisk/.npm
Expand Down Expand Up @@ -165,6 +167,7 @@ jobs:
- checkout
- install_project_dependencies:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Linting project
command: npm run lint
Expand All @@ -179,6 +182,7 @@ jobs:
- install_shellspec_dependencies
- install_project_dependencies:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- attach_workspace:
at: .
- run:
Expand Down Expand Up @@ -214,9 +218,10 @@ jobs:
node_version: << parameters.node_version >>
- install_sdks_windows
- install_project_dependencies:
npm_cache_directory: ~\AppData\Local\npm-cache
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
npm_global_sudo: false
npm_cache_directory: ~\AppData\Local\npm-cache
- attach_workspace:
at: .
- run:
Expand Down Expand Up @@ -289,6 +294,7 @@ jobs:
- install_sdks_linux
- install_project_dependencies:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- attach_workspace:
at: .
- run:
Expand Down Expand Up @@ -351,6 +357,7 @@ jobs:
- install_release_dependencies
- install_project_dependencies:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- attach_workspace:
at: .
- run:
Expand Down Expand Up @@ -392,6 +399,7 @@ jobs:
- install_release_dependencies
- install_project_dependencies:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- attach_workspace:
at: .
- run:
Expand Down Expand Up @@ -448,7 +456,7 @@ workflows:
- master

- test-windows:
name: Windows, Node v14.17.5 - Packages, Jest, System Tests
name: Windows, Node v16.13.1 - Packages, Jest, System Tests
context: nodejs-install
requires:
- Build
Expand All @@ -460,7 +468,7 @@ workflows:
system_tests: true
package_tests: true
- test-windows:
name: Windows, Node v14.17.5 - Acceptance Tests
name: Windows, Node v16.13.1 - Acceptance Tests
context: nodejs-install
requires:
- Build
Expand All @@ -470,7 +478,7 @@ workflows:
- master
acceptance_tests: true
- test-windows:
name: Windows, Node v14.17.5 - Root Tap Tests
name: Windows, Node v16.13.1 - Root Tap Tests
context: nodejs-install
requires:
- Build
Expand All @@ -491,7 +499,7 @@ workflows:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.1']
jest_tests: true
system_tests: true
package_tests: true
Expand All @@ -506,7 +514,7 @@ workflows:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.1']
acceptance_tests: true
- test-linux:
name: Linux, Node v<< matrix.node_version >> - Root Tap Tests
Expand All @@ -519,7 +527,7 @@ workflows:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.1']
root_tap_tests: true

- dev-release:
Expand Down
8 changes: 4 additions & 4 deletions release-scripts/make-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set -euo pipefail

mkdir binary-releases

npx pkg . --compress Brotli -t node14-alpine-x64 -o binary-releases/snyk-alpine
npx pkg . --compress Brotli -t node14-linux-x64 -o binary-releases/snyk-linux
npx pkg . --compress Brotli -t node14-macos-x64 -o binary-releases/snyk-macos
npx pkg . --compress Brotli -t node14-win-x64 -o binary-releases/snyk-win-unsigned.exe
npx pkg . --compress Brotli -t node16-alpine-x64 -o binary-releases/snyk-alpine
npx pkg . --compress Brotli -t node16-linux-x64 -o binary-releases/snyk-linux
npx pkg . --compress Brotli -t node16-macos-x64 -o binary-releases/snyk-macos
npx pkg . --compress Brotli -t node16-win-x64 -o binary-releases/snyk-win-unsigned.exe

./docker-desktop/build.sh darwin x64
./docker-desktop/build.sh darwin arm64
Expand Down

0 comments on commit 618a721

Please sign in to comment.