sync version number to tag/release

This commit is contained in:
Pedram Amini
2025-11-26 23:31:07 -06:00
parent 091996e181
commit 0a09e19b0c
4 changed files with 36 additions and 1 deletions

View File

@@ -59,6 +59,28 @@ jobs:
with:
python-version: '3.11'
# Extract version from git tag and update package.json
- name: Set version from tag
shell: bash
env:
REF_TYPE: ${{ github.ref_type }}
REF_NAME: ${{ github.ref_name }}
run: |
if [[ "$REF_TYPE" == "tag" ]]; then
# Extract version from tag (strip 'v' prefix if present)
VERSION="${REF_NAME#v}"
echo "Setting version to: $VERSION"
# Update package.json version using node
node -e "
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
pkg.version = process.argv[1];
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
" "$VERSION"
echo "Updated package.json version to $VERSION"
grep '"version"' package.json
fi
- name: Install dependencies
run: npm ci

View File

@@ -27,3 +27,6 @@ declare module '*.webp' {
const src: string;
export default src;
}
// Vite-injected build-time constants
declare const __APP_VERSION__: string;

View File

@@ -123,7 +123,10 @@ export function AboutModal({ theme, sessions, persistedStats, onClose }: AboutMo
<div className="flex items-center gap-4">
<Wand2 className="w-12 h-12" style={{ color: theme.colors.accent }} />
<div>
<h1 className="text-2xl font-bold tracking-widest" style={{ color: theme.colors.textMain }}>MAESTRO</h1>
<div className="flex items-baseline gap-2">
<h1 className="text-2xl font-bold tracking-widest" style={{ color: theme.colors.textMain }}>MAESTRO</h1>
<span className="text-xs font-mono" style={{ color: theme.colors.textDim }}>v{__APP_VERSION__}</span>
</div>
<p className="text-xs opacity-70" style={{ color: theme.colors.textDim }}>Agent Orchestration Command Center</p>
</div>
</div>

View File

@@ -1,11 +1,18 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { readFileSync } from 'fs';
// Read version from package.json
const packageJson = JSON.parse(readFileSync(path.join(__dirname, 'package.json'), 'utf-8'));
export default defineConfig({
plugins: [react()],
root: path.join(__dirname, 'src/renderer'),
base: './',
define: {
__APP_VERSION__: JSON.stringify(packageJson.version),
},
build: {
outDir: path.join(__dirname, 'dist/renderer'),
emptyOutDir: true,