Skip to content

Commit f4a5fe3

Browse files
committed
refactor(ci): use .node-version instead of external-tools.json
Remove build-infra/external-tools.json dependency from workflows. Use .node-version file and packageManager field from package.json for tool versions instead. - ci.yml: Read Node.js version from .node-version - publish-socketbin.yml: Use node-version-file and pnpm/action-setup - Remove packages/build-infra/external-tools.json (obsolete) The build-infra package is retained for its esbuild plugins and utilities which are still used by the build system.
1 parent 2360e50 commit f4a5fe3

File tree

3 files changed

+8
-59
lines changed

3 files changed

+8
-59
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
description: 'Node.js versions to test (JSON array)'
2626
required: false
2727
type: string
28-
# Default should match packages/build-infra/external-tools.json -> node.recommendedVersion.
29-
default: '["24.10.0"]'
28+
# Default should match .node-version file.
29+
default: '["24"]'
3030

3131
permissions:
3232
contents: read
@@ -41,21 +41,10 @@ jobs:
4141
- name: Checkout repository
4242
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4343

44-
- name: Setup Node.js
45-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
46-
with:
47-
node-version-file: .node-version
48-
49-
- name: Setup pnpm
50-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
51-
52-
- name: Install dependencies
53-
run: pnpm install --frozen-lockfile
54-
55-
- name: Load Node.js version from external-tools.json
44+
- name: Load Node.js version from .node-version
5645
id: versions
5746
run: |
58-
NODE_VERSION=$(jq -r '.node.recommendedVersion' packages/build-infra/external-tools.json)
47+
NODE_VERSION=$(cat .node-version)
5948
echo "node=[\"$NODE_VERSION\"]" >> $GITHUB_OUTPUT
6049
echo "Loaded Node.js: $NODE_VERSION"
6150

.github/workflows/publish-socketbin.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,14 @@ jobs:
122122
autocrlf: false
123123
persist-credentials: false
124124

125-
- name: Load tool versions
126-
id: tools
127-
run: |
128-
# Load versions from packages/build-infra/external-tools.json
129-
NODE_VERSION=$(jq -r '.node.recommendedVersion' packages/build-infra/external-tools.json)
130-
PNPM_VERSION=$(jq -r '.pnpm.recommendedVersion' packages/build-infra/external-tools.json)
131-
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
132-
echo "pnpm-version=$PNPM_VERSION" >> $GITHUB_OUTPUT
133-
134125
- name: Setup Node.js
135126
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
136127
with:
137-
node-version: ${{ steps.tools.outputs.node-version }}
128+
node-version-file: .node-version
138129
registry-url: 'https://registry.npmjs.org'
139130

140131
- name: Setup pnpm
141-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
142-
with:
143-
version: ${{ steps.tools.outputs.pnpm-version }}
132+
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
144133

145134
- name: Install dependencies
146135
run: pnpm install --frozen-lockfile
@@ -354,25 +343,14 @@ jobs:
354343
autocrlf: false
355344
persist-credentials: false
356345

357-
- name: Load tool versions
358-
id: tools
359-
run: |
360-
# Load versions from packages/build-infra/external-tools.json
361-
NODE_VERSION=$(jq -r '.node.recommendedVersion' packages/build-infra/external-tools.json)
362-
PNPM_VERSION=$(jq -r '.pnpm.recommendedVersion' packages/build-infra/external-tools.json)
363-
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
364-
echo "pnpm-version=$PNPM_VERSION" >> $GITHUB_OUTPUT
365-
366346
- name: Setup Node.js
367347
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
368348
with:
369-
node-version: ${{ steps.tools.outputs.node-version }}
349+
node-version-file: .node-version
370350
registry-url: 'https://registry.npmjs.org'
371351

372352
- name: Setup pnpm
373-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
374-
with:
375-
version: ${{ steps.tools.outputs.pnpm-version }}
353+
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
376354

377355
- name: Install latest npm
378356
run: npm install -g npm@latest

packages/build-infra/external-tools.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)