[fix] remove deprecated Node.js 20 actions from CLI builds

This commit is contained in:
dijunkun
2026-10-30 16:39:12 +08:00
parent de1a663ab4
commit 15092b16d6
+20 -6
View File
@@ -34,12 +34,13 @@ jobs:
env:
XMAKE_VERSION: "3.1.1"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 22
package-manager-cache: false
# A runner label can receive compiler/SDK updates without changing its name.
- name: Set cache environment
id: runner-image
@@ -53,10 +54,23 @@ jobs:
xmake-version: ${{ env.XMAKE_VERSION }}
actions-cache-folder: ${{ runner.temp }}/crossdesk-cli-xmake-toolchain
actions-cache-key: cli-${{ matrix.runner }}-${{ matrix.target }}-image${{ steps.runner-image.outputs.version }}-xmake${{ env.XMAKE_VERSION }}
- uses: ilammy/msvc-dev-cmd@v1
- name: Configure MSVC (x64)
if: runner.os == 'Windows'
with:
arch: ${{ matrix.arch }}
shell: pwsh
run: |
$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
$vsPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if ($LASTEXITCODE -ne 0 -or -not $vsPath) {
throw 'Visual Studio C++ build tools were not found'
}
$previousEnv = @{}
Get-ChildItem Env: | ForEach-Object { $previousEnv[$_.Name] = $_.Value }
& (Join-Path $vsPath 'Common7\Tools\Launch-VsDevShell.ps1') -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
Get-Command cl.exe -ErrorAction Stop | Out-Null
# Persist the compiler, SDK and PATH settings for subsequent steps.
Get-ChildItem Env: | Where-Object { $previousEnv[$_.Name] -cne $_.Value } | ForEach-Object {
"$($_.Name)=$($_.Value)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Linux build tools
if: runner.os == 'Linux'
shell: bash
@@ -107,7 +121,7 @@ jobs:
run: xmake run crossdesk-cli doctor --json
- name: Package native program and npm entry
run: npm --prefix apps/cli run pack:npm
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: npm-${{ matrix.target }}
path: build/npm/*.tgz