diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 854616b1..73eb39fb 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -169,19 +169,13 @@ const Settings: React.FC = ({ settings, onSave, onClose, relayPoo
- Version {typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev'} - {typeof __GIT_COMMIT__ !== 'undefined' && __GIT_COMMIT__ ? ( - - {' '}ยท - {typeof __GIT_COMMIT_URL__ !== 'undefined' && __GIT_COMMIT_URL__ ? ( - - {__GIT_COMMIT__.slice(0, 7)} - - ) : ( - {__GIT_COMMIT__.slice(0, 7)} - )} - - ) : null} + {typeof __GIT_COMMIT_URL__ !== 'undefined' && __GIT_COMMIT_URL__ ? ( + + Version {typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev'} + + ) : ( + Version {typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : 'dev'} + )}
) diff --git a/vite.config.ts b/vite.config.ts index 8869630d..771e43c1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -36,13 +36,13 @@ const { commit, branch } = getGitMetadata() const version = getPackageVersion() const buildTime = new Date().toISOString() -function getCommitUrl(commit: string): string { - if (!commit) return '' +function getReleaseUrl(version: string): string { + if (!version) return '' const provider = process.env.VERCEL_GIT_PROVIDER || '' const owner = process.env.VERCEL_GIT_REPO_OWNER || '' const slug = process.env.VERCEL_GIT_REPO_SLUG || '' if (provider.toLowerCase() === 'github' && owner && slug) { - return `https://github.com/${owner}/${slug}/commit/${commit}` + return `https://github.com/${owner}/${slug}/releases/tag/v${version}` } try { const remote = execSync('git config --get remote.origin.url', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim() @@ -52,7 +52,7 @@ function getCommitUrl(commit: string): string { ? `https://github.com/${remote.split(':')[1]}` : remote const cleaned = https.replace(/\.git$/, '') - return `${cleaned}/commit/${commit}` + return `${cleaned}/releases/tag/v${version}` } } catch { // ignore @@ -60,7 +60,7 @@ function getCommitUrl(commit: string): string { return '' } -const commitUrl = getCommitUrl(commit) +const releaseUrl = getReleaseUrl(version) export default defineConfig({ define: { @@ -68,7 +68,7 @@ export default defineConfig({ __GIT_COMMIT__: JSON.stringify(commit), __GIT_BRANCH__: JSON.stringify(branch), __BUILD_TIME__: JSON.stringify(buildTime), - __GIT_COMMIT_URL__: JSON.stringify(commitUrl) + __GIT_COMMIT_URL__: JSON.stringify(releaseUrl) }, plugins: [ react(),