feat: implement versioning and release management in the project
- Added automatic versioning based on git tags using semantic-release in Gitea Actions. - Introduced new API endpoints `GET /version` and `GET /v1/version` to expose build metadata. - Updated Docker build process to include version and build time information in Go binaries. - Enhanced documentation with details on release processes and versioning guidelines. - Integrated version display in the web application for better user visibility.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import PanelLeftClose from '@lucide/svelte/icons/panel-left-close';
|
||||
import PanelLeftOpen from '@lucide/svelte/icons/panel-left-open';
|
||||
import AppNavLinks from './app-nav-links.svelte';
|
||||
import AppVersion from './app-version.svelte';
|
||||
import ThemeMenu from './theme-menu.svelte';
|
||||
|
||||
let {
|
||||
@@ -54,4 +55,5 @@
|
||||
</div>
|
||||
<Separator />
|
||||
<AppNavLinks {collapsed} />
|
||||
<AppVersion />
|
||||
</aside>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { apiJSON } from '$lib/api/client.js';
|
||||
|
||||
type VersionInfo = {
|
||||
version?: string;
|
||||
api_version?: string;
|
||||
};
|
||||
|
||||
let label = $state<string | null>(null);
|
||||
|
||||
onMount(() => {
|
||||
void (async () => {
|
||||
try {
|
||||
const info = await apiJSON<VersionInfo>('/v1/version');
|
||||
const ver =
|
||||
(typeof info.version === 'string' && info.version) ||
|
||||
(typeof info.api_version === 'string' && info.api_version) ||
|
||||
'';
|
||||
label = ver ? `v${ver}` : null;
|
||||
} catch {
|
||||
label = null;
|
||||
}
|
||||
})();
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if label}
|
||||
<p class="truncate px-3 pb-3 text-xs text-sidebar-foreground/45" title={label}>{label}</p>
|
||||
{/if}
|
||||
@@ -100,8 +100,13 @@
|
||||
|
||||
const versionText = $derived.by(() => {
|
||||
if (!version) return '—';
|
||||
const ver =
|
||||
(typeof version.version === 'string' && version.version) ||
|
||||
(typeof version.api_version === 'string' && version.api_version) ||
|
||||
'';
|
||||
const sha =
|
||||
typeof version.git_sha === 'string' && version.git_sha ? version.git_sha : 'unknown';
|
||||
if (ver) return `${ver} (${sha.slice(0, 12)})`;
|
||||
return sha.slice(0, 12);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user