2727 E2E_PRODUCT_01_NAME : ${{ secrets.E2E_PRODUCT_01_NAME }}
2828 E2E_USERNAME : ${{ secrets.E2E_USERNAME }}
2929jobs :
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 }}
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 :
0 commit comments