Skip to content

Commit 906b8af

Browse files
committed
feat: update app version to 1.0.3 and display it in settings page
1 parent 625ab7e commit 906b8af

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
run: |
4141
VERSION="${GITHUB_REF_NAME#v}"
4242
jq --arg v "$VERSION" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
43+
sed -i.bak "s/^version = \"[^\"]*\"/version = \"$VERSION\"/" src-tauri/Cargo.toml && rm -f src-tauri/Cargo.toml.bak
4344
4445
- name: Install frontend dependencies
4546
run: npm install

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stack"
3-
version = "0.1.1"
3+
version = "1.0.3"
44
description = "Local sample library manager"
55
authors = ["Stack"]
66
edition = "2021"

src/pages/SettingsPage.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useEffect, useState } from 'react';
2+
import { getVersion } from '@tauri-apps/api/app';
23
import { useQuery, useQueryClient } from '@tanstack/react-query';
34
import { libraryService } from '../services/libraryService';
45
import { settingsService } from '../services/settingsService';
@@ -198,6 +199,11 @@ export function SettingsPage() {
198199
const [settings, setSettings] = useState<Settings>(DEFAULT_SETTINGS);
199200
const [saving, setSaving] = useState(false);
200201
const [confirmDisablePlaygroundOpen, setConfirmDisablePlaygroundOpen] = useState(false);
202+
const [appVersion, setAppVersion] = useState<string>('');
203+
204+
useEffect(() => {
205+
getVersion().then(setAppVersion).catch(() => {});
206+
}, []);
201207

202208
// Sync OS autostart state on mount
203209
useEffect(() => {
@@ -482,7 +488,7 @@ export function SettingsPage() {
482488
{/* ── About ── */}
483489
<SettingSection title="About">
484490
<div className="rounded-md border border-gray-700 bg-gray-800 p-4 text-sm text-gray-300 space-y-2">
485-
<div><span className="text-gray-500">Version </span><span className="mono">0.1.0</span></div>
491+
<div><span className="text-gray-500">Version </span><span className="mono">{appVersion || '—'}</span></div>
486492
<div><span className="text-gray-500">Stack </span><span className="mono">Tauri 2 · React 18 · SQLite · Rust</span></div>
487493
<div className="pt-2">
488494
<Button

0 commit comments

Comments
 (0)