2626 - name : Install Node.js, NPM and Yarn
2727 uses : buildjet/setup-node@v4
2828 with :
29- node-version : 20.18 .1
29+ node-version : 22.21 .1
3030 cache : " yarn"
3131
3232 - name : Change permissions
@@ -39,10 +39,10 @@ jobs:
3939 run : python3 -m pip install packaging setuptools
4040
4141 - name : Install latest version of NPM
42- run : " sudo npm install -g npm@9 "
42+ run : " sudo npm install -g npm@10.9.4 "
4343
44- - name : Install node-gyp package
45- run :
" sudo npm install --quiet -g [email protected] " 44+ - name : Install globally node-gyp, ts-node and nx packages
45+ 4646
4747 - name : Install Yarn dependencies
4848 run : " yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
@@ -93,17 +93,17 @@ jobs:
9393 - name : Install Node.js, NPM and Yarn
9494 uses : actions/setup-node@v4
9595 with :
96- node-version : 20.18 .1
96+ node-version : 22.21 .1
9797 cache : " yarn"
9898
9999 - name : Fix node-gyp and Python
100100 run : python3 -m pip install --break-system-packages packaging setuptools
101101
102102 - name : Install latest version of NPM
103- run : " sudo npm install -g npm@9 "
103+ run : " sudo npm install -g npm@10.9.4 "
104104
105- - name : Install node-gyp package
106- run :
" sudo npm install --quiet -g [email protected] " 105+ - name : Install globally node-gyp, ts-node and nx packages
106+ 107107
108108 - name : Install Yarn dependencies
109109 run : " yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
@@ -157,17 +157,49 @@ jobs:
157157 - name : Install Node.js, NPM and Yarn
158158 uses : actions/setup-node@v4
159159 with :
160- node-version : 20.18 .1
160+ node-version : 22.21 .1
161161 cache : " yarn"
162162
163+ - name : Install Visual Studio 2022 Build Tools (VCTools)
164+ shell : powershell
165+ run : |
166+ choco install -y visualstudio2022buildtools --execution-timeout=21600 --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive --norestart"
167+
168+ - name : Configure node-gyp to use VS 2022
169+ shell : powershell
170+ run : |
171+ "GYP_MSVS_VERSION=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
172+ "npm_config_msvs_version=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
173+
163174 - name : Fix node-gyp and Python
164175 run : python3 -m pip install packaging setuptools
165176
177+ - name : Setup MSVC (VS 2022 dev env)
178+ uses : ilammy/msvc-dev-cmd@v1
179+ with :
180+ arch : x64
181+
166182 - name : Install latest version of NPM
167- run : " npm install -g npm@9 "
183+ run : " npm install -g npm@10.9.4 "
168184
169- - name : Install node-gyp package
170- run :
" npm install --quiet -g [email protected] " 185+ - name : Install globally node-gyp, ts-node and nx packages
186+ 187+
188+ - name : Configure npm python for node-gyp
189+ shell : powershell
190+ run : |
191+ $py = (Get-Command python.exe).Source
192+ Write-Host "python is: $py"
193+ "npm_config_python=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
194+ "PYTHON=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
195+
196+ - name : Show tool versions
197+ shell : powershell
198+ run : |
199+ node -v
200+ npm -v
201+ python --version
202+ python -c "import sys; print(sys.executable)"
171203
172204 - name : Install Yarn dependencies
173205 run : " yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts"
@@ -188,8 +220,30 @@ jobs:
188220 AGENT_APP_DESCRIPTION : " Ever Gauzy Agent"
189221 AGENT_APP_ID : " com.ever.gauzyagent"
190222
223+ - name : Add Yarn/Node/npm-global/node_modules to GITHUB_PATH
224+ shell : powershell
225+ run : |
226+ $yarnPath = (Get-Command yarn).Source | Split-Path -Parent
227+ $nodePath = (Get-Command node).Source | Split-Path -Parent
228+ $npmGlobalBin = npm config get prefix
229+ $localBin = Join-Path $PWD "node_modules\.bin"
230+ echo $localBin >> $env:GITHUB_PATH
231+ echo $npmGlobalBin >> $env:GITHUB_PATH
232+ echo $yarnPath >> $env:GITHUB_PATH
233+ if ($nodePath -ne $yarnPath) { echo $nodePath >> $env:GITHUB_PATH }
234+ Write-Host "Added to GITHUB_PATH: $localBin, $npmGlobalBin, $yarnPath, $nodePath"
235+
191236 - name : Build Agent
237+ shell : powershell
192238 run : |
239+ Write-Host "=== Command locations ==="
240+ Write-Host "Node: $((Get-Command node -ErrorAction SilentlyContinue).Source)"
241+ Write-Host "Yarn: $((Get-Command yarn -ErrorAction SilentlyContinue).Source)"
242+ Write-Host "ts-node: $((Get-Command ts-node -ErrorAction SilentlyContinue).Source)"
243+ Write-Host "cross-env: $((Get-Command cross-env -ErrorAction SilentlyContinue).Source)"
244+ Write-Host "nx: $((Get-Command nx -ErrorAction SilentlyContinue).Source)"
245+ Write-Host ""
246+ Write-Host "=== Starting build ==="
193247 yarn build:agent:windows:release:gh
194248 env :
195249 USE_HARD_LINKS : false
0 commit comments