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 24, 2022
1 parent e93572d commit 896844d
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 214 deletions.
23 changes: 17 additions & 6 deletions .circleci/config.yml
Expand Up @@ -9,7 +9,10 @@ defaults: &defaults
parameters:
node_version:
type: string
default: '14.17.5'
default: '16.13.2'
npm_version:
type: string
default: '8.1.2'
working_directory: /mnt/ramdisk/snyk

commands:
Expand All @@ -19,7 +22,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 @@ -158,6 +160,7 @@ jobs:
- checkout
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
npm_install: true
- persist_to_workspace:
root: .
Expand All @@ -174,19 +177,21 @@ jobs:
at: .
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Linting project
command: npm run lint
build:
<<: *defaults
docker:
- image: circleci/node:<< parameters.node_version >>
- image: cimg/node:<< parameters.node_version >>
steps:
- checkout
- attach_workspace:
at: .
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Building project
command: npm run build:prod
Expand All @@ -208,6 +213,7 @@ jobs:
- install_shellspec_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Installing test fixture dependencies
working_directory: ./test/fixtures/basic-npm
Expand Down Expand Up @@ -243,10 +249,11 @@ jobs:
node_version: << parameters.node_version >>
- install_sdks_windows
- setup_npm:
npm_cache_directory: ~\AppData\Local\npm-cache
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
npm_global_sudo: false
npm_install: true # reinstalling as workspace node_modules is for linux
npm_cache_directory: ~\AppData\Local\npm-cache
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=$env:SNYK_API_KEY"
Expand Down Expand Up @@ -291,6 +298,7 @@ jobs:
- install_sdks_linux
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
Expand Down Expand Up @@ -327,6 +335,7 @@ jobs:
- install_sdks_linux
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
Expand All @@ -347,6 +356,7 @@ jobs:
- install_release_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Updating package versions
command: ./release-scripts/update-dev-versions.sh
Expand Down Expand Up @@ -387,6 +397,7 @@ jobs:
- install_release_dependencies
- setup_npm:
node_version: << parameters.node_version >>
npm_version: << parameters.npm_version >>
- run:
name: Updating package versions
command: |
Expand Down Expand Up @@ -446,7 +457,7 @@ workflows:
ignore:
- master
- test-windows:
name: Jest Tests (Windows, Node v14.17.5)
name: Jest Tests (Windows)
context: nodejs-install
requires:
- Build
Expand All @@ -465,7 +476,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.9', '14.18.2', '16.13.2']
- test-tap:
name: Tap Tests
context: nodejs-install
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
14
16.13.2
2 changes: 1 addition & 1 deletion docker-desktop/build.sh
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

platform="${1}"
arch="${2}"
node_version="v16.13.1"
node_version="v16.13.2"
node_url="https://nodejs.org/dist/${node_version}/node-${node_version}-${platform}-${arch}.tar.gz"
build_name="snyk-for-docker-desktop-${platform}-${arch}"
build_filename="${build_name}.tar.gz"
Expand Down

0 comments on commit 896844d

Please sign in to comment.