Skip to content

Commit 97a32b5

Browse files
NanmiCoderclaude
andcommitted
fix(ci): 修复 dev 构建 workflow 矩阵 JSON 输出格式
多行 JSON 写入 GITHUB_OUTPUT 不被支持,改为用 jq -c 压缩成单行输出。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5daa381 commit 97a32b5

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

.github/workflows/build-desktop-dev.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,21 @@ jobs:
3333
steps:
3434
- id: set-matrix
3535
run: |
36-
ALL='[
37-
{"platform":"macos-latest","rust_target":"aarch64-apple-darwin","tauri_args":"--target aarch64-apple-darwin","bundles":"app,dmg","label":"macOS-ARM64","artifact_name":"desktop-macos-arm64","artifact_glob":"*.dmg"},
38-
{"platform":"macos-latest","rust_target":"x86_64-apple-darwin","tauri_args":"--target x86_64-apple-darwin","bundles":"app,dmg","label":"macOS-x64","artifact_name":"desktop-macos-x64","artifact_glob":"*.dmg"},
39-
{"platform":"windows-latest","rust_target":"x86_64-pc-windows-msvc","tauri_args":"","bundles":"nsis,msi","label":"Windows-x64","artifact_name":"desktop-windows-x64","artifact_glob":"*.exe"},
40-
{"platform":"ubuntu-22.04","rust_target":"x86_64-unknown-linux-gnu","tauri_args":"","bundles":"deb,appimage","label":"Linux-x64","artifact_name":"desktop-linux-x64","artifact_glob":"*.deb"},
41-
{"platform":"ubuntu-22.04-arm","rust_target":"aarch64-unknown-linux-gnu","tauri_args":"","bundles":"deb,appimage","label":"Linux-ARM64","artifact_name":"desktop-linux-arm64","artifact_glob":"*.deb"}
42-
]'
36+
ALL='[{"platform":"macos-latest","rust_target":"aarch64-apple-darwin","tauri_args":"--target aarch64-apple-darwin","bundles":"app,dmg","label":"macOS-ARM64","artifact_name":"desktop-macos-arm64"},{"platform":"macos-latest","rust_target":"x86_64-apple-darwin","tauri_args":"--target x86_64-apple-darwin","bundles":"app,dmg","label":"macOS-x64","artifact_name":"desktop-macos-x64"},{"platform":"windows-latest","rust_target":"x86_64-pc-windows-msvc","tauri_args":"","bundles":"nsis,msi","label":"Windows-x64","artifact_name":"desktop-windows-x64"},{"platform":"ubuntu-22.04","rust_target":"x86_64-unknown-linux-gnu","tauri_args":"","bundles":"deb,appimage","label":"Linux-x64","artifact_name":"desktop-linux-x64"},{"platform":"ubuntu-22.04-arm","rust_target":"aarch64-unknown-linux-gnu","tauri_args":"","bundles":"deb,appimage","label":"Linux-ARM64","artifact_name":"desktop-linux-arm64"}]'
4337
4438
SELECTED="${{ inputs.platforms }}"
4539
if [ "$SELECTED" = "all" ]; then
46-
echo "matrix={\"include\":$ALL}" >> "$GITHUB_OUTPUT"
40+
MATRIX=$(echo "$ALL" | jq -c '{include: .}')
4741
else
48-
echo "$ALL" | jq -c --arg sel "$SELECTED" \
49-
'{include: [.[] | select(
50-
($sel == "macos-arm64" and .label == "macOS-ARM64") or
51-
($sel == "macos-x64" and .label == "macOS-x64") or
52-
($sel == "windows-x64" and .label == "Windows-x64") or
53-
($sel == "linux-x64" and .label == "Linux-x64") or
54-
($sel == "linux-arm64" and .label == "Linux-ARM64")
55-
)]}' >> "$GITHUB_OUTPUT"
42+
MATRIX=$(echo "$ALL" | jq -c --arg sel "$SELECTED" '{include: [.[] | select(
43+
($sel == "macos-arm64" and .label == "macOS-ARM64") or
44+
($sel == "macos-x64" and .label == "macOS-x64") or
45+
($sel == "windows-x64" and .label == "Windows-x64") or
46+
($sel == "linux-x64" and .label == "Linux-x64") or
47+
($sel == "linux-arm64" and .label == "Linux-ARM64")
48+
)]}')
5649
fi
50+
echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
5751
5852
# ── 构建 ────────────────────────────────────────────────────
5953
build:

0 commit comments

Comments
 (0)