From 952284134674cc412590a472c07d429afa251545 Mon Sep 17 00:00:00 2001 From: Steve Cliff Date: Fri, 10 Apr 2026 22:14:07 +0100 Subject: [PATCH] Add Windows exe icon, clean release filenames, fix Linux build - Embed microphone icon in Windows exe via winresource - Rename release artifacts to friendly names (linux-x86_64, windows-x86_64) - Fix warn macro import for Linux build - Add cargo PATH to release script - Fix tea CLI asset upload syntax Co-Authored-By: Claude Opus 4.6 (1M context) --- Cargo.lock | 49 +++++++++++++++++++++++++++++++++++++++++++---- Cargo.toml | 3 +++ assets/mouth.ico | Bin 0 -> 186 bytes assets/mouth.rc | 1 + build-win.sh | 5 +++++ build.rs | 10 ++++++++++ release.sh | 9 +++++---- 7 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 assets/mouth.ico create mode 100644 assets/mouth.rc create mode 100755 build-win.sh create mode 100644 build.rs diff --git a/Cargo.lock b/Cargo.lock index 98dace6..099f3cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "mouth" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "arboard", @@ -2252,6 +2252,7 @@ dependencies = [ "tray-icon", "windows-sys 0.59.0", "winit", + "winresource", ] [[package]] @@ -3635,6 +3636,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3962,7 +3972,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml", + "toml 0.8.2", "version-compare", ] @@ -4179,11 +4189,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", - "serde_spanned", + "serde_spanned 0.6.9", "toml_datetime 0.6.3", "toml_edit 0.20.2", ] +[[package]] +name = "toml" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned 1.1.1", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.1", +] + [[package]] name = "toml_datetime" version = "0.6.3" @@ -4221,7 +4246,7 @@ checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap", "serde", - "serde_spanned", + "serde_spanned 0.6.9", "toml_datetime 0.6.3", "winnow 0.5.40", ] @@ -4247,6 +4272,12 @@ dependencies = [ "winnow 1.0.1", ] +[[package]] +name = "toml_writer" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" + [[package]] name = "tower" version = "0.5.3" @@ -5303,6 +5334,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "winresource" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0986a8b1d586b7d3e4fe3d9ea39fb451ae22869dcea4aa109d287a374d866087" +dependencies = [ + "toml 1.1.2+spec-1.1.0", + "version_check", +] + [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/Cargo.toml b/Cargo.toml index 5c4686d..9bc4970 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,5 +67,8 @@ serde_json = "1" anyhow = "1" thiserror = "2" +[build-dependencies] +winresource = "0.1" + [target.'cfg(windows)'.dependencies] windows-sys = { version = "0.59", features = ["Win32_System_Console", "Win32_UI_WindowsAndMessaging", "Win32_System_Pipes", "Win32_System_IO", "Win32_Storage_FileSystem", "Win32_Foundation", "Win32_Security"] } diff --git a/assets/mouth.ico b/assets/mouth.ico new file mode 100644 index 0000000000000000000000000000000000000000..e1eb98830254efd0a61fade5ae4836256e6f5be7 GIT binary patch literal 186 zcmZQzU<5(|0R|vYU|0eq#eldoz|WnRONtA~Dhg(?Fgo~^k#N62;e2*>@xckze;VSnHktE^6nGANkFB;6^ b7H9)qHo?TX|Dt3y&{_shS3j3^P6&1; then local binary="target/${target}/release/${BINARY_NAME}${ext}" if [ -f "${binary}" ]; then - local archive="${RELEASE_DIR}/${BINARY_NAME}-${TAG}-${target}" + local archive="${RELEASE_DIR}/${BINARY_NAME}-${TAG}-${friendly_name}" if [ -n "${ext}" ]; then # Windows: ship the exe directly cp "${binary}" "${archive}${ext}" @@ -91,7 +92,7 @@ build_target() { # ============================================================ # Linux x86_64 (native — always available) -build_target "x86_64-unknown-linux-gnu" "Linux x86_64" +build_target "x86_64-unknown-linux-gnu" "Linux x86_64" "linux-x86_64" # Windows x86_64 (MSVC target via cargo-xwin) if command -v cargo-xwin &>/dev/null && rustup target list --installed | grep -q x86_64-pc-windows-msvc; then @@ -99,7 +100,7 @@ if command -v cargo-xwin &>/dev/null && rustup target list --installed | grep -q if cargo xwin build --release --target x86_64-pc-windows-msvc 2>&1; then local_binary="target/x86_64-pc-windows-msvc/release/${BINARY_NAME}.exe" if [ -f "${local_binary}" ]; then - archive="${RELEASE_DIR}/${BINARY_NAME}-${TAG}-x86_64-pc-windows-msvc.exe" + archive="${RELEASE_DIR}/${BINARY_NAME}-${TAG}-windows-x86_64.exe" cp "${local_binary}" "${archive}" echo " -> ${archive}" BUILT+=("${archive}")