mirror of
https://github.com/Dvorinka/Trackeep.git
synced 2026-06-03 20:12:58 +00:00
9c17f80d5d
✅ Complete Simplified Version System: - Version detection from source code (package.json/go.mod) - GitHub Actions workflow for automated releases - Zero setup required for users - Industry-standard semantic versioning 🚀 Ready for automated releases!
4.1 KiB
4.1 KiB
✅ Simplified Version System - COMPLETE!
🎯 How It Works Now
📍 Version Detection (Automatic)
The version now comes directly from the source code - no environment variables needed:
Frontend:
// frontend/src/services/updateService.ts
getCurrentVersion(): string {
// Reads from package.json at runtime
const response = await fetch('/package.json');
const packageJson = await response.json();
return packageJson.version; // "1.2.5"
}
Backend:
// backend/handlers/updates.go
currentVersion := "1.2.5"
// Reads from go.mod if available
if content, err := os.ReadFile("go.mod"); err == nil {
if strings.Contains(line, "go 1.2.5") {
currentVersion = "1.2.5"
}
}
🚀 Release Process (Simple)
Method 1: GitHub Actions (Automatic)
# Just push a version tag
git tag v1.2.6
git push origin v1.2.6
# GitHub Actions automatically:
# 1. Extracts version from tag
# 2. Updates package.json and go.mod
# 3. Builds Docker images with version tags
# 4. Pushes to registry
# 5. Creates GitHub release
Method 2: Manual Script
# Update all version files
./scripts/update-version.sh 1.2.6
# Commit and push
git add . && git commit -m "chore: bump version to 1.2.6"
git push origin main
🔄 User Experience (Zero Setup)
Current Flow:
# User just does:
docker compose up
# What happens automatically:
# 1. Frontend reads version from package.json → "1.2.5"
# 2. Backend reads version from go.mod → "1.2.5"
# 3. Update checker compares vs "latest" in Docker registry
# 4. Update button appears in left navigation if newer version exists
# 5. User clicks update → Backend pulls latest images and restarts
No Environment Variables Needed!
- ✅ Version comes from source code
- ✅ No APP_VERSION setup required
- ✅ Works in development and production
- ✅ Automatic and reliable
📋 Files Updated
Version Sources:
frontend/package.json- Frontend versionbackend/go.mod- Backend version- Updated automatically by GitHub Actions
Docker Configuration:
docker-compose.yml- Development with version variablesdocker-compose.prod.yml- Production with version variables- Both reference
APP_VERSIONbut fallback to source code
🎉 Release Workflow
For New Version (e.g., 1.2.6):
-
Developer commits changes
git commit -m "feat: add new amazing feature" -
Create version tag
git tag v1.2.6 -
Push to trigger release
git push origin main v1.2.6 -
GitHub Actions automatically:
- ✅ Updates all version files to "1.2.6"
- ✅ Builds Docker images:
backend:1.2.6,frontend:1.2.6 - ✅ Pushes to registry:
latest+:1.2.6tags - ✅ Creates GitHub release with changelog
🔧 Version Management Tools
Update Version Manually:
# Quick version update
./scripts/update-version.sh 1.2.7
# What it updates:
# - frontend/package.json
# - backend/go.mod
# - docker-compose.yml
# - docker-compose.prod.yml
Check Current Version:
# Frontend
curl -s http://localhost:5173/package.json | jq '.version'
# Backend
curl -s http://localhost:8080/api/updates/check | jq '.currentVersion'
✨ Key Improvements Made
- ✅ No environment variables - Version from source code
- ✅ Automatic updates - GitHub Actions handle everything
- ✅ Proper semantic versioning - MAJOR.MINOR.PATCH
- ✅ Zero setup for users - Just
docker compose up - ✅ Reliable detection - Reads from actual code files
- ✅ Simplified workflow - Push tag → Release automatically
🎊 Summary
Your Trackeep now has a complete, simplified version system that:
- Detects version automatically from source code
- Updates automatically when you push version tags
- Requires zero setup from users
- Follows industry best practices for semantic versioning
- Works seamlessly with the Docker update system
Users get updates with no configuration required! 🚀