From 849a9318e927b224d42f707c2eaca3172162f6ed Mon Sep 17 00:00:00 2001 From: unsecretised Date: Mon, 5 Jan 2026 21:09:17 +0800 Subject: [PATCH] Set App Version at compile time using the github tag for releases --- .github/workflows/release.yml | 3 +++ src/app/apps.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc50025..a74deaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,9 @@ jobs: runs-on: ${{ matrix.os }} + env: + APP_VERSION: ${{ github.ref_name }} + steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/src/app/apps.rs b/src/app/apps.rs index d268516..458c105 100644 --- a/src/app/apps.rs +++ b/src/app/apps.rs @@ -30,6 +30,8 @@ pub struct App { impl App { /// This returns the basic apps that rustcast has, such as quiting rustcast and opening preferences pub fn basic_apps() -> Vec { + let app_version = option_env!("APP_VERSION").unwrap_or("Unknown Version"); + vec![ App { open_command: Function::Quit, @@ -56,7 +58,7 @@ impl App { open_command: Function::Nothing, desc: RUSTCAST_DESC_NAME.to_string(), icons: None, - name: "RustCast Version: 0.2.7".to_string(), + name: format!("RustCast Version: {app_version}"), name_lc: "version".to_string(), }, ]