displaying version number and changed versioning approach
This commit is contained in:
parent
b0ed682060
commit
72b4fa8710
|
|
@ -25,6 +25,7 @@ COPY --from=builder /install /usr/local
|
|||
COPY backend ./backend
|
||||
COPY frontend ./frontend
|
||||
COPY config.yaml .
|
||||
COPY VERSION .
|
||||
COPY plugins ./plugins
|
||||
COPY themes ./themes
|
||||
COPY generate_password.py .
|
||||
|
|
|
|||
|
|
@ -43,6 +43,14 @@ config_path = Path(__file__).parent.parent / "config.yaml"
|
|||
with open(config_path, 'r', encoding='utf-8') as f:
|
||||
config = yaml.safe_load(f)
|
||||
|
||||
# Load version from VERSION file (single source of truth)
|
||||
version_path = Path(__file__).parent.parent / "VERSION"
|
||||
if not version_path.exists():
|
||||
raise FileNotFoundError("VERSION file not found. Please create it with the current version number.")
|
||||
with open(version_path, 'r', encoding='utf-8') as f:
|
||||
version = f.read().strip()
|
||||
config['app']['version'] = version
|
||||
|
||||
# Initialize app
|
||||
app = FastAPI(
|
||||
title=config['app']['name'],
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
app:
|
||||
name: "NoteDiscovery"
|
||||
tagline: "Your Self-Hosted Knowledge Base"
|
||||
version: "1.0.0"
|
||||
|
||||
server:
|
||||
host: "0.0.0.0"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ function noteApp() {
|
|||
// App state
|
||||
appName: 'NoteDiscovery',
|
||||
appTagline: 'Your Self-Hosted Knowledge Base',
|
||||
appVersion: '0.0.0',
|
||||
notes: [],
|
||||
currentNote: '',
|
||||
currentNoteName: '',
|
||||
|
|
@ -394,6 +395,7 @@ function noteApp() {
|
|||
const config = await response.json();
|
||||
this.appName = config.name;
|
||||
this.appTagline = config.tagline;
|
||||
this.appVersion = config.version || '0.0.0';
|
||||
} catch (error) {
|
||||
console.error('Failed to load config:', error);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -995,6 +995,8 @@
|
|||
<div class="p-3 border-t" style="border-color: var(--border-primary);">
|
||||
<div class="text-xs text-center" style="color: var(--text-tertiary);">
|
||||
<span x-text="notes.length"></span> notes
|
||||
<span class="mx-1">·</span>
|
||||
<span x-text="'v' + appVersion"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,56 @@
|
|||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Version,
|
||||
|
||||
[Parameter(Mandatory=$false)]
|
||||
[switch]$SkipCommit = $false
|
||||
)
|
||||
|
||||
# Validate version format (semantic versioning)
|
||||
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
||||
Write-Host "Error: Version must be in format X.Y.Z (e.g., 0.4.0)" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Releasing version $Version..." -ForegroundColor Green
|
||||
|
||||
# Check if working directory is clean (unless skipping commit)
|
||||
if (-not $SkipCommit) {
|
||||
$status = git status --porcelain
|
||||
if ($status) {
|
||||
Write-Host "Warning: Working directory has uncommitted changes:" -ForegroundColor Yellow
|
||||
Write-Host $status -ForegroundColor Yellow
|
||||
$response = Read-Host "Continue anyway? (y/N)"
|
||||
if ($response -ne 'y' -and $response -ne 'Y') {
|
||||
Write-Host "Aborted." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Update VERSION file (single source of truth)
|
||||
Write-Host "Updating VERSION file..." -ForegroundColor Yellow
|
||||
$Version | Out-File -FilePath "VERSION" -Encoding utf8 -NoNewline
|
||||
|
||||
# Commit changes (unless skipped)
|
||||
if (-not $SkipCommit) {
|
||||
Write-Host "Committing version changes..." -ForegroundColor Yellow
|
||||
git add VERSION
|
||||
git commit -m "Bump version to $Version"
|
||||
|
||||
# Push commits first
|
||||
Write-Host "Pushing commits..." -ForegroundColor Yellow
|
||||
git push
|
||||
}
|
||||
|
||||
# Create git tag
|
||||
Write-Host "Creating git tag v$Version..." -ForegroundColor Yellow
|
||||
git tag -a "v$Version" -m "Release version $Version"
|
||||
|
||||
# Push tag to remote
|
||||
Write-Host "Pushing tag to remote..." -ForegroundColor Yellow
|
||||
git push origin "v$Version"
|
||||
|
||||
Write-Host "`nRelease $Version completed successfully!" -ForegroundColor Green
|
||||
Write-Host "Tag: v$Version" -ForegroundColor Cyan
|
||||
|
||||
Loading…
Reference in New Issue