feat: implement automated versioning and update docs
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-15 16:06:38 +01:00
parent cd7707a725
commit bc40969ad7
7 changed files with 67 additions and 4 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
HOOK_DIR=".git/hooks"
HOOK_FILE="$HOOK_DIR/pre-commit"
echo "Setting up pre-commit hook in $HOOK_FILE..."
# Create hooks directory if it doesn't exist (unlikely in a git repo, but good practice)
mkdir -p "$HOOK_DIR"
# Create the pre-commit script
cat > "$HOOK_FILE" << 'EOF'
#!/bin/sh
# Auto-increment patch version for every commit
# --no-git-tag-version prevents creating a git tag for every commit (too noisy)
# The version bump happens BEFORE the commit object is created.
echo "🤖 Bumping patch version..."
if npm version patch --no-git-tag-version; then
# Add the updated package.json and package-lock.json to the index
# so they are included in the CURRENT commit.
git add package.json package-lock.json
echo "✅ Version bumped and added to commit."
else
echo "❌ Version bump failed. Aborting commit."
exit 1
fi
EOF
# Make executable
chmod +x "$HOOK_FILE"
echo "✅ Git pre-commit hook installed successfully!"