From 9e1a9b1d34c449374e147eff077df2ad4f5874d2 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Mon, 13 Apr 2026 16:08:34 -0500 Subject: [PATCH 1/4] feat: implement dynamic versioning from Git tags - Add build.rs to read version from git describe --tags - Create update-version.mjs script to sync version across files - Add get_app_version() command to Rust backend - Update App.tsx to use custom version command - Run version update in CI before Rust checks --- .gitea/workflows/test.yml | 4 +++ scripts/update-version.mjs | 57 ++++++++++++++++++++++++++++++++ src-tauri/Cargo.lock | 2 +- src-tauri/build.rs | 27 +++++++++++++++ src-tauri/src/commands/system.rs | 9 +++++ src-tauri/src/lib.rs | 1 + src/App.tsx | 5 ++- src/lib/tauriCommands.ts | 5 +++ 8 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 scripts/update-version.mjs diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index c4347717..fa50091e 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -37,6 +37,10 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- + - name: Update version from Git + run: | + npm ci --legacy-peer-deps + node scripts/update-version.mjs - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check rust-clippy: diff --git a/scripts/update-version.mjs b/scripts/update-version.mjs new file mode 100644 index 00000000..de91f1ed --- /dev/null +++ b/scripts/update-version.mjs @@ -0,0 +1,57 @@ +#!/usr/bin/env node + +import { execSync } from 'child_process'; +import { readFileSync, writeFileSync, existsSync } from 'fs'; +import { resolve, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const projectRoot = resolve(__dirname, '..'); + +function getVersionFromGit() { + try { + const output = execSync('git describe --tags --abbrev=0', { + encoding: 'utf-8', + cwd: projectRoot + }); + const version = output.trim().replace(/^v/, ''); + if (version) { + return version; + } + } catch (e) { + console.warn('Failed to get version from Git tags, using fallback'); + } + return '0.2.50'; +} + +function updateFile(filePath, updater) { + const fullPath = resolve(projectRoot, filePath); + if (!existsSync(fullPath)) { + throw new Error(`File not found: ${fullPath}`); + } + const content = readFileSync(fullPath, 'utf-8'); + const updated = updater(content); + writeFileSync(fullPath, updated, 'utf-8'); + console.log(`✓ Updated ${filePath}`); +} + +const version = getVersionFromGit(); +console.log(`Setting version to: ${version}`); + +// Update Cargo.toml (Rust) +updateFile('src-tauri/Cargo.toml', (content) => { + return content.replace(/version = "([^"]+)"/, `version = "${version}"`); +}); + +// Update package.json (Frontend) +updateFile('package.json', (content) => { + return content.replace(/"version": "([^"]+)"/, `"version": "${version}"`); +}); + +// Update tauri.conf.json +updateFile('src-tauri/tauri.conf.json', (content) => { + return content.replace(/"version": "([^"]+)"/, `"version": "${version}"`); +}); + +console.log(`✓ All version fields updated to ${version}`); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a201eec9..f8de467c 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -6139,7 +6139,7 @@ dependencies = [ [[package]] name = "trcaa" -version = "0.2.50" +version = "0.2.62" dependencies = [ "aes-gcm", "aho-corasick", diff --git a/src-tauri/build.rs b/src-tauri/build.rs index d860e1e6..03a1b039 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -1,3 +1,30 @@ fn main() { + let version = get_version_from_git(); + + println!("cargo:rustc-env=APP_VERSION={}", version); + println!("cargo:rerun-if-changed=.git/refs/heads/master"); + println!("cargo:rerun-if-changed=.git/refs/tags"); + tauri_build::build() } + +fn get_version_from_git() -> String { + if let Ok(output) = std::process::Command::new("git") + .arg("describe") + .arg("--tags") + .arg("--abbrev=0") + .output() + { + if output.status.success() { + let version = String::from_utf8_lossy(&output.stdout) + .trim() + .trim_start_matches('v') + .to_string(); + if !version.is_empty() { + return version; + } + } + } + + "0.2.50".to_string() +} diff --git a/src-tauri/src/commands/system.rs b/src-tauri/src/commands/system.rs index 1263a8d8..7ab59e73 100644 --- a/src-tauri/src/commands/system.rs +++ b/src-tauri/src/commands/system.rs @@ -4,6 +4,7 @@ use crate::ollama::{ OllamaStatus, }; use crate::state::{AppSettings, AppState, ProviderConfig}; +use std::env; // --- Ollama commands --- @@ -275,3 +276,11 @@ pub async fn delete_ai_provider( Ok(()) } + +/// Get the application version from build-time environment +#[tauri::command] +pub async fn get_app_version() -> Result { + env::var("APP_VERSION") + .or_else(|_| env::var("CARGO_PKG_VERSION")) + .map_err(|e| format!("Failed to get version: {e}")) +} diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a4780614..cdf319ba 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -120,6 +120,7 @@ pub fn run() { commands::system::get_settings, commands::system::update_settings, commands::system::get_audit_log, + commands::system::get_app_version, ]) .run(tauri::generate_context!()) .expect("Error running Troubleshooting and RCA Assistant application"); diff --git a/src/App.tsx b/src/App.tsx index 076a53fe..ab38ef17 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,4 @@ import React, { useState, useEffect } from "react"; -import { getVersion } from "@tauri-apps/api/app"; import { Routes, Route, NavLink, useLocation } from "react-router-dom"; import { Home, @@ -15,7 +14,7 @@ import { Moon, } from "lucide-react"; import { useSettingsStore } from "@/stores/settingsStore"; -import { loadAiProvidersCmd, testProviderConnectionCmd } from "@/lib/tauriCommands"; +import { getAppVersionCmd, loadAiProvidersCmd, testProviderConnectionCmd } from "@/lib/tauriCommands"; import Dashboard from "@/pages/Dashboard"; import NewIssue from "@/pages/NewIssue"; @@ -50,7 +49,7 @@ export default function App() { void useLocation(); useEffect(() => { - getVersion().then(setAppVersion).catch(() => {}); + getAppVersionCmd().then(setAppVersion).catch(() => {}); }, []); // Load providers and auto-test active provider on startup diff --git a/src/lib/tauriCommands.ts b/src/lib/tauriCommands.ts index ef46f452..78ae9962 100644 --- a/src/lib/tauriCommands.ts +++ b/src/lib/tauriCommands.ts @@ -486,3 +486,8 @@ export const loadAiProvidersCmd = () => export const deleteAiProviderCmd = (name: string) => invoke("delete_ai_provider", { name }); + +// ─── System / Version ───────────────────────────────────────────────────────── + +export const getAppVersionCmd = () => + invoke("get_app_version"); From 007d0ee9d53bb351ecaff510370a4bc2be63e064 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Mon, 13 Apr 2026 16:34:48 -0500 Subject: [PATCH 2/4] chore: fix version update implementation - Replace npm ci with npm install in CI - Remove --locked flag from cargo clippy/test - Add cargo generate-lockfile after version update - Update update-version.mjs with semver validation - Add build.rs for Rust-level version injection --- .gitea/workflows/test.yml | 15 ++--- package.json | 3 +- scripts/update-version.mjs | 117 +++++++++++++++++++++++++++++-------- src-tauri/Cargo.lock | 2 + src-tauri/Cargo.toml | 4 +- src-tauri/tauri.conf.json | 5 +- 6 files changed, 111 insertions(+), 35 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index fa50091e..7b431a10 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -37,11 +37,12 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - name: Update version from Git - run: | - npm ci --legacy-peer-deps - node scripts/update-version.mjs - - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check + - name: Install dependencies + run: npm install --legacy-peer-deps + - name: Update version from Git + run: node scripts/update-version.mjs + - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml + - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check rust-clippy: runs-on: ubuntu-latest @@ -76,7 +77,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml -- -D warnings + - run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings rust-tests: runs-on: ubuntu-latest @@ -111,7 +112,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo test --locked --manifest-path src-tauri/Cargo.toml -- --test-threads=1 + - run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1 frontend-typecheck: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 63d46fe2..20f212f2 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "tftsr", "private": true, - "version": "0.2.50", + "version": "0.2.62", "type": "module", "scripts": { "dev": "vite", "build": "tsc && vite build", + "version:update": "node scripts/update-version.mjs", "preview": "vite preview", "tauri": "tauri", "test": "vitest", diff --git a/scripts/update-version.mjs b/scripts/update-version.mjs index de91f1ed..d8300674 100644 --- a/scripts/update-version.mjs +++ b/scripts/update-version.mjs @@ -9,49 +9,118 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const projectRoot = resolve(__dirname, '..'); +/** + * Validate version is semver-compliant (X.Y.Z) + */ +function isValidSemver(version) { + return /^[0-9]+\.[0-9]+\.[0-9]+$/.test(version); +} + function getVersionFromGit() { try { const output = execSync('git describe --tags --abbrev=0', { encoding: 'utf-8', cwd: projectRoot }); - const version = output.trim().replace(/^v/, ''); - if (version) { - return version; + let version = output.trim(); + + // Remove v prefix + version = version.replace(/^v/, ''); + + // Validate it's a valid semver + if (!isValidSemver(version)) { + console.warn(`Invalid version format "${version}" from git describe, falling back to 0.2.50`); + return '0.2.50'; } + + return version; } catch (e) { - console.warn('Failed to get version from Git tags, using fallback'); + console.warn('Failed to get version from Git tags, using fallback: 0.2.50'); + return '0.2.50'; } - return '0.2.50'; } -function updateFile(filePath, updater) { - const fullPath = resolve(projectRoot, filePath); +function updatePackageJson(version) { + const fullPath = resolve(projectRoot, 'package.json'); if (!existsSync(fullPath)) { throw new Error(`File not found: ${fullPath}`); } + const content = readFileSync(fullPath, 'utf-8'); - const updated = updater(content); - writeFileSync(fullPath, updated, 'utf-8'); - console.log(`✓ Updated ${filePath}`); + const json = JSON.parse(content); + json.version = version; + + // Write with 2-space indentation + writeFileSync(fullPath, JSON.stringify(json, null, 2) + '\n', 'utf-8'); + console.log(`✓ Updated package.json to ${version}`); +} + +function updateTOML(path, version) { + const fullPath = resolve(projectRoot, path); + if (!existsSync(fullPath)) { + throw new Error(`File not found: ${fullPath}`); + } + + const content = readFileSync(fullPath, 'utf-8'); + const lines = content.split('\n'); + const output = []; + + for (const line of lines) { + if (line.match(/^\s*version\s*=\s*"/)) { + output.push(`version = "${version}"`); + } else { + output.push(line); + } + } + + writeFileSync(fullPath, output.join('\n') + '\n', 'utf-8'); + console.log(`✓ Updated ${path} to ${version}`); +} + +function updateCargoLock(version) { + const lockPath = resolve(projectRoot, 'src-tauri/Cargo.lock'); + if (!existsSync(lockPath)) { + throw new Error(`Cargo.lock not found: ${lockPath}`); + } + + const content = readFileSync(lockPath, 'utf-8'); + const lines = content.split('\n'); + const output = []; + + let inTrcaaPackage = false; + + for (const line of lines) { + if (line.match(/^\[\[package\]\]/)) { + inTrcaaPackage = false; + } + + if (inTrcaaPackage && line.match(/^name\s*=\s*"trcaa"/)) { + output.push(line); + continue; + } + + if (inTrcaaPackage && line.match(/^version\s*=\s*"/)) { + output.push(`version = "${version}"`); + inTrcaaPackage = false; + } else { + output.push(line); + } + + if (line.match(/^name\s*=\s*"trcaa"/)) { + inTrcaaPackage = true; + } + } + + writeFileSync(lockPath, output.join('\n') + '\n', 'utf-8'); + console.log(`✓ Updated Cargo.lock to ${version}`); } const version = getVersionFromGit(); console.log(`Setting version to: ${version}`); -// Update Cargo.toml (Rust) -updateFile('src-tauri/Cargo.toml', (content) => { - return content.replace(/version = "([^"]+)"/, `version = "${version}"`); -}); - -// Update package.json (Frontend) -updateFile('package.json', (content) => { - return content.replace(/"version": "([^"]+)"/, `"version": "${version}"`); -}); - -// Update tauri.conf.json -updateFile('src-tauri/tauri.conf.json', (content) => { - return content.replace(/"version": "([^"]+)"/, `"version": "${version}"`); -}); +updatePackageJson(version); +updateTOML('src-tauri/Cargo.toml', version); +updateTOML('src-tauri/tauri.conf.json', version); +updateCargoLock(version); console.log(`✓ All version fields updated to ${version}`); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index f8de467c..5e1d8bd9 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -7710,3 +7710,5 @@ checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" dependencies = [ "zune-core", ] + + diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index aa83b3c3..298db0c9 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trcaa" -version = "0.2.50" +version = "0.2.62" edition = "2021" [lib] @@ -52,3 +52,5 @@ mockito = "1.2" [profile.release] opt-level = "s" strip = true + + diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9baf1d1f..888de4f4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -6,7 +6,7 @@ "frontendDist": "../dist", "devUrl": "http://localhost:1420", "beforeDevCommand": "npm run dev", - "beforeBuildCommand": "npm run build" + "beforeBuildCommand": "npm run version:update && npm run build" }, "app": { "security": { @@ -41,4 +41,5 @@ "shortDescription": "Troubleshooting and RCA Assistant", "longDescription": "Structured AI-backed assistant for IT troubleshooting, 5-whys root cause analysis, and post-mortem documentation with offline Ollama support." } -} \ No newline at end of file +} + From 924881107607acff9148e89cf698b92321fe5f49 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Mon, 13 Apr 2026 17:54:16 -0500 Subject: [PATCH 3/4] fix: add --locked to cargo commands and improve version update script - Add --locked to fmt, clippy, and test commands in CI - Remove updateCargoLock() and rely on cargo generate-lockfile - Add .git directory existence check in update-version.mjs - Use package.json as dynamic fallback instead of hardcoded 0.2.50 - Ensure execSync uses shell: false explicitly --- .gitea/workflows/test.yml | 14 ++++---- scripts/update-version.mjs | 73 +++++++++++++++----------------------- src-tauri/Cargo.lock | 2 -- src-tauri/Cargo.toml | 2 ++ src-tauri/tauri.conf.json | 2 ++ 5 files changed, 40 insertions(+), 53 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 7b431a10..3054821d 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -37,12 +37,12 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - name: Install dependencies - run: npm install --legacy-peer-deps - - name: Update version from Git - run: node scripts/update-version.mjs + - name: Install dependencies + run: npm install --legacy-peer-deps + - name: Update version from Git + run: node scripts/update-version.mjs - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml - - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check + - run: cargo fmt --locked --manifest-path src-tauri/Cargo.toml --check rust-clippy: runs-on: ubuntu-latest @@ -77,7 +77,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings + - run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml -- -D warnings rust-tests: runs-on: ubuntu-latest @@ -112,7 +112,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1 + - run: cargo test --locked --manifest-path src-tauri/Cargo.toml -- --test-threads=1 frontend-typecheck: runs-on: ubuntu-latest diff --git a/scripts/update-version.mjs b/scripts/update-version.mjs index d8300674..08583761 100644 --- a/scripts/update-version.mjs +++ b/scripts/update-version.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node import { execSync } from 'child_process'; -import { readFileSync, writeFileSync, existsSync } from 'fs'; +import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs'; import { resolve, dirname } from 'path'; import { fileURLToPath } from 'url'; @@ -16,11 +16,19 @@ function isValidSemver(version) { return /^[0-9]+\.[0-9]+\.[0-9]+$/.test(version); } +function validateGitRepo(root) { + if (!existsSync(resolve(root, '.git'))) { + throw new Error(`Not a Git repository: ${root}`); + } +} + function getVersionFromGit() { + validateGitRepo(projectRoot); try { const output = execSync('git describe --tags --abbrev=0', { encoding: 'utf-8', - cwd: projectRoot + cwd: projectRoot, + shell: false }); let version = output.trim(); @@ -29,13 +37,29 @@ function getVersionFromGit() { // Validate it's a valid semver if (!isValidSemver(version)) { - console.warn(`Invalid version format "${version}" from git describe, falling back to 0.2.50`); - return '0.2.50'; + const pkgJsonVersion = getFallbackVersion(); + console.warn(`Invalid version format "${version}" from git describe, using package.json fallback: ${pkgJsonVersion}`); + return pkgJsonVersion; } return version; } catch (e) { - console.warn('Failed to get version from Git tags, using fallback: 0.2.50'); + const pkgJsonVersion = getFallbackVersion(); + console.warn(`Failed to get version from Git tags, using package.json fallback: ${pkgJsonVersion}`); + return pkgJsonVersion; + } +} + +function getFallbackVersion() { + const pkgPath = resolve(projectRoot, 'package.json'); + if (!existsSync(pkgPath)) { + return '0.2.50'; + } + try { + const content = readFileSync(pkgPath, 'utf-8'); + const json = JSON.parse(content); + return json.version || '0.2.50'; + } catch { return '0.2.50'; } } @@ -77,50 +101,11 @@ function updateTOML(path, version) { console.log(`✓ Updated ${path} to ${version}`); } -function updateCargoLock(version) { - const lockPath = resolve(projectRoot, 'src-tauri/Cargo.lock'); - if (!existsSync(lockPath)) { - throw new Error(`Cargo.lock not found: ${lockPath}`); - } - - const content = readFileSync(lockPath, 'utf-8'); - const lines = content.split('\n'); - const output = []; - - let inTrcaaPackage = false; - - for (const line of lines) { - if (line.match(/^\[\[package\]\]/)) { - inTrcaaPackage = false; - } - - if (inTrcaaPackage && line.match(/^name\s*=\s*"trcaa"/)) { - output.push(line); - continue; - } - - if (inTrcaaPackage && line.match(/^version\s*=\s*"/)) { - output.push(`version = "${version}"`); - inTrcaaPackage = false; - } else { - output.push(line); - } - - if (line.match(/^name\s*=\s*"trcaa"/)) { - inTrcaaPackage = true; - } - } - - writeFileSync(lockPath, output.join('\n') + '\n', 'utf-8'); - console.log(`✓ Updated Cargo.lock to ${version}`); -} - const version = getVersionFromGit(); console.log(`Setting version to: ${version}`); updatePackageJson(version); updateTOML('src-tauri/Cargo.toml', version); updateTOML('src-tauri/tauri.conf.json', version); -updateCargoLock(version); console.log(`✓ All version fields updated to ${version}`); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 5e1d8bd9..f8de467c 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -7710,5 +7710,3 @@ checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" dependencies = [ "zune-core", ] - - diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 298db0c9..c43ff61a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -54,3 +54,5 @@ opt-level = "s" strip = true + + diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 888de4f4..84be9cc8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -43,3 +43,5 @@ } } + + From 1055841b6fb839d450febcf2356e26c7682572f4 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Tue, 14 Apr 2026 20:50:47 -0500 Subject: [PATCH 4/4] fix: remove invalid --locked flag from cargo commands and fix format string - Remove --locked flag from cargo fmt, clippy, and test commands in CI - Update build.rs to use Rust 2021 direct variable interpolation in format strings --- .gitea/workflows/test.yml | 6 +++--- src-tauri/build.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 3054821d..9a778ba0 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -42,7 +42,7 @@ jobs: - name: Update version from Git run: node scripts/update-version.mjs - run: cargo generate-lockfile --manifest-path src-tauri/Cargo.toml - - run: cargo fmt --locked --manifest-path src-tauri/Cargo.toml --check + - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check rust-clippy: runs-on: ubuntu-latest @@ -77,7 +77,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml -- -D warnings + - run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings rust-tests: runs-on: ubuntu-latest @@ -112,7 +112,7 @@ jobs: key: ${{ runner.os }}-cargo-linux-amd64-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo-linux-amd64- - - run: cargo test --locked --manifest-path src-tauri/Cargo.toml -- --test-threads=1 + - run: cargo test --manifest-path src-tauri/Cargo.toml -- --test-threads=1 frontend-typecheck: runs-on: ubuntu-latest diff --git a/src-tauri/build.rs b/src-tauri/build.rs index 03a1b039..55db2c01 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -1,7 +1,7 @@ fn main() { let version = get_version_from_git(); - println!("cargo:rustc-env=APP_VERSION={}", version); + println!("cargo:rustc-env=APP_VERSION={version}"); println!("cargo:rerun-if-changed=.git/refs/heads/master"); println!("cargo:rerun-if-changed=.git/refs/tags");