feat: Implementato sistema di versioning automatizzato con MinVer e Gitea Actions
- Aggiunto MinVer per calcolo automatico versione da git tags - Creato modello VersionInfo e servizio VersionService - Integrato display versione nel NavMenu (Data_Coupler v2.1.0) - Aggiornato workflow Gitea Actions (Linux e Windows) per generare version.json - Risolto problema inconsistenza versioning tra container Linux e Windows - Documentazione completa: VERSIONING_SYSTEM.md e MINVER_SETUP.md - Versione ora calcolata automaticamente da git tags (Semantic Versioning)
This commit was merged in pull request #10.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
namespace Data_Coupler.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Modello per le informazioni di versione dell'applicazione
|
||||
/// </summary>
|
||||
public class VersionInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Versione principale (es. "2.1.0")
|
||||
/// </summary>
|
||||
public string Version { get; set; } = "0.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Commit SHA breve (es. "abc1234")
|
||||
/// </summary>
|
||||
public string CommitSha { get; set; } = "unknown";
|
||||
|
||||
/// <summary>
|
||||
/// Branch Git (es. "main", "development")
|
||||
/// </summary>
|
||||
public string Branch { get; set; } = "unknown";
|
||||
|
||||
/// <summary>
|
||||
/// Data e ora del build
|
||||
/// </summary>
|
||||
public string BuildDate { get; set; } = "unknown";
|
||||
|
||||
/// <summary>
|
||||
/// Ambiente di build (es. "Docker", "Local")
|
||||
/// </summary>
|
||||
public string BuildEnvironment { get; set; } = "Local";
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce una stringa formattata con la versione completa
|
||||
/// </summary>
|
||||
public string GetFullVersion()
|
||||
{
|
||||
if (CommitSha != "unknown" && Branch != "unknown")
|
||||
{
|
||||
return $"v{Version} ({Branch}-{CommitSha})";
|
||||
}
|
||||
return $"v{Version}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce una stringa formattata breve per l'UI
|
||||
/// </summary>
|
||||
public string GetShortVersion()
|
||||
{
|
||||
return $"v{Version}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user