mirror of
https://github.com/letieu/terminal.css.git
synced 2026-03-15 02:04:30 -07:00
Bump version: v0.0.3 → v0.0.4
This commit is contained in:
38
release.sh
Executable file
38
release.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# 1. Get latest git tag
|
||||
oldTag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
|
||||
|
||||
echo "Latest tag: $oldTag"
|
||||
read -p "Enter new tag: " newTag
|
||||
|
||||
if [ -z "$newTag" ]; then
|
||||
echo "New tag cannot be empty!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating $oldTag -> $newTag ..."
|
||||
|
||||
# 2. Escape dots for sed
|
||||
oldTagEscaped=$(printf '%s\n' "$oldTag" | sed 's/\./\\./g')
|
||||
newTagEscaped=$(printf '%s\n' "$newTag" | sed 's/\./\\./g')
|
||||
|
||||
# 3. Replace in files
|
||||
grep -rl "$oldTag" . | xargs sed -i "s/$oldTagEscaped/$newTagEscaped/g"
|
||||
|
||||
echo "Files updated."
|
||||
|
||||
# 4. Git commit changes
|
||||
git add .
|
||||
git commit -m "Bump version: $oldTag → $newTag"
|
||||
|
||||
# 5. Create new tag
|
||||
git tag "$newTag"
|
||||
|
||||
# 6. Push commit + tag
|
||||
git push
|
||||
git push origin "$newTag"
|
||||
|
||||
echo "Version bump complete: $oldTag → $newTag"
|
||||
Reference in New Issue
Block a user