Skip to content

Commit

Permalink
Set Node version in a single place (#6534)
Browse files Browse the repository at this point in the history
This should make it much easier to update.  Also use 18.15.0
specifically since that is what VS Code ships with.

Additionally, it fixes the post-install script being skipped due to
a Yarn v1 bug that happens when Yarn installs node-gyp, which
it does because 18.18 onward stopped bundling node-gyp.
  • Loading branch information
code-asher authored Nov 14, 2023
1 parent 239df56 commit da254c3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
files: |
docs/**
- name: Install Node.js v18
- name: Install Node.js
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version
cache: "yarn"

- name: Install doctoc
Expand Down Expand Up @@ -115,11 +115,11 @@ jobs:
files_ignore: |
lib/vscode/**
- name: Install Node.js v18
- name: Install Node.js
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down Expand Up @@ -170,11 +170,11 @@ jobs:
files_ignore: |
lib/vscode/**
- name: Install Node.js v18
- name: Install Node.js
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down Expand Up @@ -224,10 +224,10 @@ jobs:
- name: Patch Code
run: quilt push -a

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down Expand Up @@ -298,10 +298,10 @@ jobs:
- name: Install system dependencies
run: sudo apt update && sudo apt install -y libkrb5-dev

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down Expand Up @@ -357,10 +357,10 @@ jobs:
- name: Install system dependencies
run: sudo apt update && sudo apt install -y libkrb5-dev

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Fetch dependencies from cache
id: cache-node-modules
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- name: Checkout code-server
uses: actions/checkout@v4

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version
cache: "yarn"

- name: Download npm package from release artifacts
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18.15.0"
node-version-file: .node-version

- name: Install development tools
run: |
Expand Down Expand Up @@ -128,7 +128,6 @@ jobs:
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
TARGET_ARCH: ${{ matrix.apt_arch }}
npm_config_arch: ${{ matrix.npm_arch }}
NODE_VERSION: v18.15.0
# Not building from source results in an x86_64 argon2, as if
# npm_config_arch is being ignored.
npm_config_build_from_source: true
Expand All @@ -137,10 +136,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18.15.0"
node-version-file: .node-version

- name: Install cross-compiler and system dependencies
run: |
Expand Down Expand Up @@ -174,8 +173,9 @@ jobs:

- name: Replace node with cross-compile equivalent
run: |
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${npm_config_arch}.tar.xz
tar -xf node-${NODE_VERSION}-linux-${npm_config_arch}.tar.xz node-${NODE_VERSION}-linux-${npm_config_arch}/bin/node --strip-components=2
node_version=$(node --version)
wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
mv ./node ./release-standalone/lib/node
# NOTE@jsjoeio - we do this so we can strip out the v
Expand Down Expand Up @@ -205,10 +205,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18.15.0"
node-version-file: .node-version

- name: Install nfpm
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js v18
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
node-version-file: .node-version

- name: Audit yarn for vulnerabilities
run: yarn audit
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
18.15.0

0 comments on commit da254c3

Please sign in to comment.