From 7d4d0cb9210ccc416e4bf7bc7445a104a29686ea Mon Sep 17 00:00:00 2001 From: nako-ruru Date: Sat, 5 Dec 2026 09:06:15 +0800 Subject: [PATCH] feat(cli): print the build id on --version (#7129) `openidea --version` prints a second line `Build #` from `OPENIDEA_BUILD` at compile time (`dev` when unset, like the About dialog). The release build job now sets `OPENIDEA_BUILD` to the commit SHA, so official builds report it in About and on --version instead of `dev`. Co-authored-by: nako-ruru <26663548+nako-ruru@users.noreply.github.com> --- .github/workflows/release-build.yml | 1 + src-tauri/src/cli.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 9061d8f95d..9f2140ec4d 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -47,6 +47,7 @@ jobs: environment: release env: OPENIDEA_OFFICIAL_PLUGIN_KEYS: ${{ needs.plugin-keys.outputs.keys }} + OPENIDEA_BUILD: ${{ github.sha }} strategy: fail-fast: false matrix: diff --git a/src-tauri/src/cli.rs b/src-tauri/src/cli.rs index 61750797c3..e4307d1972 100644 --- a/src-tauri/src/cli.rs +++ b/src-tauri/src/cli.rs @@ -44,6 +44,7 @@ fn client(identifier: &str, args: &[String]) -> Result<(), String> { } Command::Version => { println!("OpenIDEA {}", env!("CARGO_PKG_VERSION")); + println!("Build #{}", option_env!("OPENIDEA_BUILD").unwrap_or("dev")); return Ok(()); } Command::Open(targets) | Command::Diff(targets) => targets,