2025-04-08 10:37:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Get current version
|
|
|
|
current_version=$(jq -r '.version' package.json)
|
|
|
|
echo "Current version: $current_version"
|
|
|
|
|
|
|
|
# Determine new version (example: increment patch)
|
|
|
|
IFS='.' read -r major minor patch <<< "$current_version"
|
|
|
|
new_patch=$((patch + 1))
|
|
|
|
new_version="$major.$minor.$new_patch"
|
|
|
|
echo "New version: $new_version"
|
|
|
|
|
|
|
|
# Update package.json
|
|
|
|
jq ".version = \"$new_version\"" package.json > temp.json && mv temp.json package.json
|
2025-04-08 10:46:12 +00:00
|
|
|
|
|
|
|
# Optional: Commit and tag
|
2025-04-08 10:51:49 +00:00
|
|
|
|
2025-04-08 11:02:14 +00:00
|
|
|
echo ${ secrets.PACKAGES_USER }
|
2025-04-08 11:00:38 +00:00
|
|
|
git config --global user.name ${{ secrets.PACKAGES_USER }}
|
2025-04-08 10:46:12 +00:00
|
|
|
git add package.json
|
2025-04-08 10:48:35 +00:00
|
|
|
echo "adding succeeded"
|
2025-04-08 10:46:12 +00:00
|
|
|
git commit -m "Bump version to $new_version"
|
2025-04-08 10:48:35 +00:00
|
|
|
echo "commiting succeeded"
|
2025-04-08 10:46:12 +00:00
|
|
|
git tag -a "v$new_version" -m "Release version $new_version"
|
2025-04-08 10:48:35 +00:00
|
|
|
echo "tagging succeeded"
|
2025-04-08 10:55:30 +00:00
|
|
|
git remote -v
|
2025-04-08 10:48:35 +00:00
|
|
|
git push main HEAD --tags
|
|
|
|
echo "pushing succeeded"
|