Windows: shippable cross-compiled .zip + console fix + release CI

The tree already links a working x86_64-pc-windows-gnu exe; turn that into
a shipped artifact:

- scripts/package.sh gains a `win` target (and `all` picks it up when the
  mingw toolchain is present) that cross-compiles and zips the exe +
  LICENSE + a README listing the yt-dlp/ffmpeg/mpv PATH deps.
- Forgejo release workflow installs mingw-w64 + zip + the rust target, so
  a tag push produces yt-offline-<ver>-x86_64-windows.zip from the same
  Linux container — no Windows runner needed.
- main.rs: attach_windows_console() (cfg(windows), windows-sys
  AttachConsole) reattaches a release build to the launching terminal so
  --web/CLI output is visible, while a double-click stays windowless
  (release sets windows_subsystem = "windows").
- ROADMAP 3.1 updated: Windows ships; macOS deferred (needs a Mac runner).

Native Linux build + 128 unit / 11 integration tests still green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Luna 2026-06-16 02:31:38 -07:00
parent 8b2578783a
commit 207013e957
6 changed files with 187 additions and 34 deletions

View file

@ -52,6 +52,14 @@ rfd = { version = "0.15", default-features = false, features = ["xdg-portal", "t
[target.'cfg(not(target_os = "linux"))'.dependencies]
rfd = { version = "0.15", features = ["tokio"] }
# Release Windows builds are linked as a GUI subsystem app (no console window —
# see the windows_subsystem attribute in main.rs), which is right for the egui
# GUI but means a `--web`/CLI run launched from a terminal has nowhere to print.
# windows-sys gives us AttachConsole to reattach to the launching console at
# runtime (see attach_windows_console in main.rs).
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = ["Win32_System_Console"] }
[profile.release]
opt-level = 3
# Thin LTO does cross-crate inlining without the rust-lld + bundled-sqlite