Skip to content

Commit 9fec48f

Browse files
authored
Merge pull request #875 from particle-iot/chore/sc-135584/cli-node-22
chore: [sc-135584] CLI Node 22
2 parents 6dbe8e4 + a649a58 commit 9fec48f

File tree

261 files changed

+10176
-15225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+10176
-15225
lines changed

.eslintrc.js

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

.github/workflows/reusable-build.yml

Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ env:
2727
E2E_PRODUCT_01_NAME: ${{ secrets.E2E_PRODUCT_01_NAME }}
2828
E2E_USERNAME: ${{ secrets.E2E_USERNAME }}
2929
jobs:
30-
build:
30+
linux-build:
3131
runs-on: ubuntu-latest # Choose an appropriate runner
3232
steps:
3333
- uses: actions/checkout@v3
3434

3535
- name: Set up Node.js
36-
uses: actions/setup-node@v3
36+
uses: actions/setup-node@v4
3737
with:
38-
node-version: '16'
38+
node-version: '22'
3939

4040
- name: Configure NPM Token
4141
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
@@ -47,13 +47,8 @@ jobs:
4747
uses: actions/cache@v3
4848
with:
4949
path: ~/.pkg-cache
50-
key: node16-pkg-${{ github.run_id }}
51-
restore-keys: node16-pkg-
52-
53-
- name: Add pre-built Node for armv7
54-
run: |
55-
mkdir -p ~/.pkg-cache/v3.4
56-
cp .prebuild/built-v16.16.0-linux-armv7 ~/.pkg-cache/v3.4
50+
key: node22-pkg-${{ github.run_id }}
51+
restore-keys: node22-pkg-
5752

5853
- name: Set up QEMU
5954
uses: docker/setup-qemu-action@v3
@@ -64,24 +59,68 @@ jobs:
6459
uses: MOZGIII/install-ldid-action@v1
6560
with:
6661
tag: v2.1.5-procursus7
62+
# Follow instructions are required to build linux and keep backwards compatibility with ubuntu 20.04
63+
- name: Build linux x64
64+
run: npx --yes @yao-pkg/[email protected] . --target node22-linux-x64 -o build/particle-cli-linux-x64
65+
- name: Build linux arm64
66+
run: npx --yes @yao-pkg/[email protected] . --target node22-linux-arm64 -o build/particle-cli-linux-arm64
67+
- name: Build linux armv7
68+
run: npx --yes @yao-pkg/[email protected] . --target node22-linuxstatic-armv7 -o build/particle-cli-linuxstatic-armv7
69+
70+
- name: Save Cache
71+
uses: actions/cache@v3
72+
with:
73+
path: ~/.pkg-cache
74+
key: node22-pkg-${{ github.run_id }}
75+
76+
- name: Upload Artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: not_signed_linux
80+
path: build/
81+
macos-build:
82+
runs-on: macos-latest
83+
steps:
84+
- uses: actions/checkout@v3
85+
86+
- name: Set up Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: '22'
90+
91+
- name: Configure NPM Token
92+
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
6793

68-
- name: Build Package
69-
run: npm run build
94+
- name: Install dependencies
95+
run: npm install
96+
97+
- name: Restore Cache
98+
uses: actions/cache@v3
99+
with:
100+
path: ~/.pkg-cache
101+
key: node22-pkg-${{ github.run_id }}
102+
restore-keys: node22-pkg-
103+
- name: Build macos x64
104+
run: npm run build -- --target node22-macos-x64 -o build/particle-cli-macos-x64
105+
- name: Build macos arm64
106+
run: npm run build -- --target node22-macos-arm64 -o build/particle-cli-macos-arm64
70107

71108
- name: Save Cache
72109
uses: actions/cache@v3
73110
with:
74111
path: ~/.pkg-cache
75-
key: node16-pkg-${{ github.run_id }}
112+
key: node22-pkg-${{ github.run_id }}
76113

77114
- name: Upload Artifact
78115
uses: actions/upload-artifact@v4
79116
with:
80-
name: not_signed
117+
name: not_signed_mac
81118
path: build/
82119
windows-sign:
83120
runs-on: windows-latest
84-
needs: build
121+
needs:
122+
- linux-build
123+
- macos-build
85124
steps:
86125
- uses: actions/checkout@v3
87126
- name: Install NSIS
@@ -90,11 +129,30 @@ jobs:
90129
shell: pwsh
91130
run: |
92131
echo "${env:ProgramFiles(x86)}\NSIS\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
132+
- name: Set up Node.js
133+
uses: actions/setup-node@v4
134+
with:
135+
node-version: '22'
136+
137+
- name: Configure NPM Token
138+
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
139+
140+
- name: Install dependencies
141+
run: npm install
142+
143+
- name: Restore Cache
144+
uses: actions/cache@v3
145+
with:
146+
path: ~/.pkg-cache
147+
key: node22-pkg-${{ github.run_id }}
148+
restore-keys: node22-pkg-
93149
- name: Download Artifact
94150
uses: actions/download-artifact@v5
95151
with:
96-
name: not_signed
97152
path: build/
153+
merge-multiple: true
154+
- name: Build windows x64
155+
run: npm run build -- --target node22-win-x64 -o build/particle-cli-win-x64
98156
- name: Sign Windows Executable
99157
uses: azure/trusted-signing-action@v0
100158
with:

.github/workflows/reusable-publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Node.js
1111
uses: actions/setup-node@v3
1212
with:
13-
node-version: '16'
13+
node-version: '22'
1414
- name: Configure NPM Token
1515
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}
1616
- name: Install dependencies

.github/workflows/reusable-publish-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Node.js
2525
uses: actions/setup-node@v3
2626
with:
27-
node-version: '16'
27+
node-version: '22'
2828
- name: Configure NPM Token
2929
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
3030

.github/workflows/reusable-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run Tests
22

3-
on:
3+
on:
44
workflow_call:
55
inputs:
66
skipE2E:
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ${{ matrix.os }}
3939
strategy:
4040
matrix:
41-
node-version: [16.x]
41+
node-version: [22.x]
4242
os: [ubuntu-latest, windows-latest, macOS-latest]
4343
steps:
4444
- uses: actions/checkout@v3
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: ${{ matrix.os }}
5858
strategy:
5959
matrix:
60-
node-version: [16.x]
60+
node-version: [22.x]
6161
os: [ubuntu-latest, macOS-latest]
6262
steps:
6363
- uses: actions/checkout@v3

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
22
Binary file not shown.

eslint.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { particle } from 'eslint-config-particle';
2+
3+
export default particle({
4+
rootDir: import.meta.dirname,
5+
testGlobals: 'mocha',
6+
overrides: {
7+
'no-console': 'off'
8+
},
9+
globalIgnores: [
10+
'./test/__fixtures__/logic_functions/lf*_proj/*.js'
11+
]
12+
});

0 commit comments

Comments
 (0)