From 49bfaba64fbfe565605c2a7681659d3369e123a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Tue, 5 May 2026 23:21:22 +0800 Subject: [PATCH] Keep release builds free of CI warnings Release logs showed two warning classes after the packaging fixes: Linux builds warned about macOS-only menu imports, and tauri-action reported an unknown releaseAssetNamePattern input. Gate the native menu imports to macOS and use the action's supported assetNamePattern input so release logs stay clean and asset naming is actually applied. Constraint: Linux release builds compile the shared Tauri lib without macOS-only menu usage Constraint: tauri-action v0 accepts assetNamePattern, not releaseAssetNamePattern Rejected: Ignore warning-only output | release candidates should not hide real signal behind avoidable warnings Confidence: high Scope-risk: narrow Directive: Keep workflow input names aligned with tauri-action's published action schema Tested: cargo fmt --check Tested: cargo check --target aarch64-apple-darwin Tested: git diff --check Not-tested: Full GitHub release workflow after retag before pushing --- .github/workflows/release-desktop.yml | 2 +- desktop/src-tauri/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 3489e574..74952d01 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -177,5 +177,5 @@ jobs: releaseDraft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }} prerelease: false updaterJsonPreferNsis: true - releaseAssetNamePattern: ${{ matrix.asset_name_pattern }} + assetNamePattern: ${{ matrix.asset_name_pattern }} args: ${{ matrix.tauri_args }} --ci --config src-tauri/tauri.release-ci.json diff --git a/desktop/src-tauri/src/lib.rs b/desktop/src-tauri/src/lib.rs index a7a1d320..53d61012 100644 --- a/desktop/src-tauri/src/lib.rs +++ b/desktop/src-tauri/src/lib.rs @@ -16,6 +16,7 @@ use std::{ use portable_pty::{native_pty_system, ChildKiller, CommandBuilder, MasterPty, PtySize}; use serde::{Deserialize, Serialize}; +#[cfg(target_os = "macos")] use tauri::menu::{MenuBuilder, MenuItemBuilder, SubmenuBuilder}; use tauri::tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}; use tauri::Emitter;