ease setting new Version

This commit is contained in:
2026-01-14 23:14:07 +01:00
parent 7adff0e5be
commit 5a93b0cf71
+53 -14
View File
@@ -4,14 +4,31 @@
set -e
if [ -z "$1" ]; then
echo "Usage: $0 <backend_version> [frontend_version]"
echo "Usage: $0 <backend_version> [frontend_version] [auto]"
echo "Example: $0 0.1.31 # Sets both to 0.1.31"
echo "Example: $0 0.1.31 0.2.0 # Sets different versions"
echo "Example: $0 0.1.31 auto # Sets both to 0.1.31 and auto-commits"
echo "Example: $0 0.1.31 0.2.0 auto # Sets different versions and auto-commits"
exit 1
fi
# Parse arguments
BACKEND_VERSION="$1"
FRONTEND_VERSION="${2:-$1}" # Use backend version if frontend not specified
AUTO_COMMIT=false
# Check if second argument is "auto"
if [ "$2" = "auto" ]; then
FRONTEND_VERSION="$1"
AUTO_COMMIT=true
elif [ -z "$2" ]; then
FRONTEND_VERSION="$1"
elif [ "$3" = "auto" ]; then
FRONTEND_VERSION="$2"
AUTO_COMMIT=true
else
FRONTEND_VERSION="$2"
fi
if [ "$BACKEND_VERSION" = "$FRONTEND_VERSION" ]; then
echo "Updating both backend and frontend to version $BACKEND_VERSION..."
@@ -64,17 +81,39 @@ echo "✅ Version update complete!"
echo " Backend: $BACKEND_VERSION"
echo " Frontend: $FRONTEND_VERSION"
echo ""
echo "Next steps:"
echo "1. Review changes: git diff"
if [ "$BACKEND_VERSION" = "$FRONTEND_VERSION" ]; then
echo "2. Commit changes: git commit -am 'Bump version to $BACKEND_VERSION'"
echo "3. Tag release: git tag v$BACKEND_VERSION"
git tag v$BACKEND_VERSION
# Auto-commit if requested
if [ "$AUTO_COMMIT" = true ]; then
echo "Auto-committing changes..."
if [ "$BACKEND_VERSION" = "$FRONTEND_VERSION" ]; then
git add backend/config/version.go frontend/src/version.js frontend/package.json frontend/VERSION.md
git commit -m "Bump version to $BACKEND_VERSION"
git tag v$BACKEND_VERSION
echo "✓ Committed and tagged as v$BACKEND_VERSION"
else
git add backend/config/version.go frontend/src/version.js frontend/package.json frontend/VERSION.md
git commit -m "Bump backend to $BACKEND_VERSION, frontend to $FRONTEND_VERSION"
git tag backend-v$BACKEND_VERSION
git tag frontend-v$FRONTEND_VERSION
git tag v$BACKEND_VERSION -m "Backend version $BACKEND_VERSION, Frontend version $FRONTEND_VERSION"
echo "✓ Committed and tagged as backend-v$BACKEND_VERSION, frontend-v$FRONTEND_VERSION, v$BACKEND_VERSION"
fi
echo ""
echo "Next step:"
echo " Push: git push && git push --tags"
else
echo "2. Commit changes: git commit -am 'Bump backend to $BACKEND_VERSION, frontend to $FRONTEND_VERSION'"
echo "3. Tag releases: git tag backend-v$BACKEND_VERSION && git tag frontend-v$FRONTEND_VERSION"
git tag backend-v$BACKEND_VERSION
git tag frontend-v$FRONTEND_VERSION
git tag v$BACKEND_VERSION -m "Backend version $BACKEND_VERSION, Frontend version $FRONTEND_VERSION"
echo "Next steps:"
echo "1. Review changes: git diff"
if [ "$BACKEND_VERSION" = "$FRONTEND_VERSION" ]; then
echo "2. Commit changes: git commit -am 'Bump version to $BACKEND_VERSION'"
echo "3. Tag release: git tag v$BACKEND_VERSION"
git tag v$BACKEND_VERSION
else
echo "2. Commit changes: git commit -am 'Bump backend to $BACKEND_VERSION, frontend to $FRONTEND_VERSION'"
echo "3. Tag releases: git tag backend-v$BACKEND_VERSION && git tag frontend-v$FRONTEND_VERSION"
git tag backend-v$BACKEND_VERSION
git tag frontend-v$FRONTEND_VERSION
git tag v$BACKEND_VERSION -m "Backend version $BACKEND_VERSION, Frontend version $FRONTEND_VERSION"
fi
echo "4. Push: git push && git push --tags"
fi
echo "4. Push: git push && git push --tags"