mirror of
https://github.com/Dvorinka/Trackeep.git
synced 2026-06-03 20:12:58 +00:00
chore: update to v1.2.5 and simplify version management
🎯 Simplified Version System: - Update frontend/backend to v1.2.5 in package.json and go.mod - Frontend reads version from package.json directly - Backend reads version from go.mod directly - No environment variables needed for versioning 🔄 Automated Release Workflow: - GitHub Actions automatically updates all version files - Extracts version from Git tag (v1.2.5) - Updates package.json, go.mod, docker-compose files - Builds and pushes Docker images with proper tags - Creates GitHub release automatically 🚀 User Experience: - Just: docker compose up - System auto-detects version from code - Updates work with no manual setup - Proper semantic versioning (MAJOR.MINOR.PATCH) Ready for automated release!
This commit is contained in:
@@ -71,10 +71,25 @@ func CheckForUpdates(c *gin.Context) {
|
||||
updateMutex.Lock()
|
||||
defer updateMutex.Unlock()
|
||||
|
||||
// Get current version from environment or default
|
||||
currentVersion := os.Getenv("APP_VERSION")
|
||||
if currentVersion == "" {
|
||||
currentVersion = "1.0.0"
|
||||
// Get current version from go.mod
|
||||
currentVersion := "1.2.5"
|
||||
|
||||
// Try to read from go.mod if running in development
|
||||
if _, err := os.Stat("go.mod"); err == nil {
|
||||
if content, err := os.ReadFile("go.mod"); err == nil {
|
||||
lines := strings.Split(string(content), "\n")
|
||||
for _, line := range lines {
|
||||
if strings.Contains(line, "go ") && strings.Contains(line, "1.2.5") {
|
||||
// Extract version from go.mod
|
||||
parts := strings.Fields(line)
|
||||
if len(parts) >= 2 {
|
||||
currentVersion = strings.TrimSpace(parts[1])
|
||||
log.Printf("Found version in go.mod: %s", currentVersion)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Checking for updates using Docker registry (current version: %s)", currentVersion)
|
||||
|
||||
Reference in New Issue
Block a user