### Set up and run Tauri dev server Source: https://github.com/alanbulan/tunefree/blob/tauri/README.md Install dependencies and start the Tauri development environment. The Vite dev server listens on 127.0.0.1:3101. Run this in an environment with Node.js 24.15+, npm 12.0.2, Rust 1.98.1, and the platform-specific build tools (Windows: Visual Studio C++ Build Tools and WebView2; macOS: Xcode Command Line Tools). ```sh npm ci npm run tauri dev ``` -------------------------------- ### 本地构建(不生成安装包) Source: https://github.com/alanbulan/tunefree/blob/tauri/INSTALL_GUIDE.md 使用 npx tauri build --no-bundle 只验证桌面程序,不生成安装包。 ```powershell npx tauri build --no-bundle ``` -------------------------------- ### 生成 macOS 通用包 Source: https://github.com/alanbulan/tunefree/blob/tauri/INSTALL_GUIDE.md 在 Mac 上生成通用包,需要先添加目标平台,然后使用 npx tauri build --target universal-apple-darwin --bundles app,dmg。Tauri 自动合并 tauri.macos.conf.json,产物位于 src-tauri/target/universal-apple-darwin/release/bundle/。 ```sh rustup target add aarch64-apple-darwin x86_64-apple-darwin npx tauri build --target universal-apple-darwin --bundles app,dmg ``` -------------------------------- ### 读取 Windows DPAPI 密码备份 (PowerShell) Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 用于读取当前 Windows 用户的 DPAPI 密码备份,以获取签名私钥密码。该命令从 `%LOCALAPPDATA%\TuneFree\signing\updater.key.password.dpapi` 读取加密内容并解密为明文密码。 ```powershell $encrypted = Get-Content -Raw "$env:LOCALAPPDATA\TuneFree\signing\updater.key.password.dpapi" $password = [System.Net.NetworkCredential]::new('', (ConvertTo-SecureString $encrypted)).Password ``` -------------------------------- ### 为当前版本补发 Mac 包:运行 release.yml 工作流 Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 使用 gh workflow run 触发 release.yml 工作流,指定 ref 为 tauri,并传递 tag 参数为 v1.1.31。该命令用于补充已有 Release 的 Mac 资产,跳过 Windows 重新打包与公开步骤。构建源码来自指定的 --ref,其应用版本必须与 tag 一致。目标 Release 必须已存在且不是预发布版本,已有 Mac 资产时默认拒绝覆盖。 ```sh gh workflow run release.yml --ref tauri -f tag=v1.1.31 ``` -------------------------------- ### 恢复草稿发布:执行 publish-release.mjs --publish Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 在确认共享门禁和 Mac job 成功后,设置 GITHUB_REPOSITORY 和 RELEASE_TAG 环境变量,然后执行 node scripts/publish-release.mjs --publish 来公开草稿发布。脚本会校验两平台资产和更新清单后公开,不能提前公开只有 Windows 资产的草稿。 ```sh node scripts/publish-release.mjs --publish ``` -------------------------------- ### 常用检查命令 Source: https://github.com/alanbulan/tunefree/blob/tauri/INSTALL_GUIDE.md 运行版本检查、类型检查、lint、架构检查、测试和 Rust 检查。npm run test:coverage 会额外生成 coverage/lcov.info。 ```powershell npm run version:check npm run typecheck npm run lint npm run architecture:check npm test -- --run cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings cargo test --manifest-path src-tauri/Cargo.toml --locked ``` -------------------------------- ### Run CI-aligned verification commands Source: https://github.com/alanbulan/tunefree/blob/tauri/README.md Runs the full verification suite aligned with CI. This sequence matches the shared Windows gate. For macOS, first build via Tauri CLI to synchronize platform configuration, then run Cargo checks; the exact order is in release.yml. Clippy rules are strict in Cargo.toml; beforeBuildCommand already includes the frontend build, so do not run npm run build separately. ```sh npm run version:check npm run lint npm run typecheck npm run architecture:check npm run test:coverage npm run audit cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check cargo clippy --manifest-path src-tauri/Cargo.toml --locked --all-targets --all-features -- -D warnings cargo test --manifest-path src-tauri/Cargo.toml --locked --test app_tests -- --include-ignored npx tauri build --no-bundle npm run smoke ``` -------------------------------- ### 升级后检查版本:npm run version:check Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 在版本升级后执行,用于验证版本号是否一致。 ```powershell npm run version:check ``` -------------------------------- ### 生成 Windows NSIS 安装包 Source: https://github.com/alanbulan/tunefree/blob/tauri/INSTALL_GUIDE.md 使用 npm run tauri build 生成 Windows NSIS 安装包,输出目录为 src-tauri/target/release/bundle/nsis/。 ```powershell npm run tauri build ``` -------------------------------- ### 提交与标签命令组 Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 用于提交代码并创建标签,版本号与标签必须一致。示例中版本升级为 1.1.32。 ```powershell git add -A git commit -m "release: prepare v1.1.32" git tag -a v1.1.32 -m "TuneFree v1.1.32" git push origin tauri git push origin v1.1.32 ``` -------------------------------- ### Verify real GD Music API sources Source: https://github.com/alanbulan/tunefree/blob/tauri/README.md Runs real music source verification against the GD Music API. The first command verifies with default settings; the second adds the --source joox and --details flags. This is separate from the automated tests and is needed to validate real external sources. ```sh npm run api:verify:gd npm run api:verify:gd -- --source joox --details ``` -------------------------------- ### 升级补丁版本:npm run version:bump Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 用于升级补丁版本,脚本会同步更新 package.json、package-lock.json、src-tauri/tauri.conf.json、src-tauri/Cargo.toml 和 src-tauri/Cargo.lock。 ```powershell npm run version:bump ``` -------------------------------- ### 发布前验证命令组 Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 这组命令与 .github/workflows/validate.yml 一一对应,用于本地提前发现问题。包括 npm ci、version:check、lint、typecheck、architecture:check、test:coverage、audit、cargo fmt、cargo clippy、cargo test、tauri build、smoke 和 git diff。 ```powershell npm ci npm run version:check npm run lint npm run typecheck npm run architecture:check npm run test:coverage npm run audit cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check cargo clippy --manifest-path src-tauri/Cargo.toml --locked --all-targets --all-features -- -D warnings cargo test --manifest-path src-tauri/Cargo.toml --locked --test app_tests -- --include-ignored npx tauri build --no-bundle npm run smoke git diff --exit-code ``` -------------------------------- ### 只读验收已公开版本:使用 --allow-published 标志 Source: https://github.com/alanbulan/tunefree/blob/tauri/RELEASE.md 使用 node scripts/publish-release.mjs --allow-published 可只读验收已公开版本,需设置 GITHUB_REPOSITORY 和 RELEASE_TAG 环境变量。脚本优先使用 RELEASE_TAG,普通标签发布回落到 GITHUB_REF_NAME。 ```sh node scripts/publish-release.mjs --allow-published ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.