-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# Define the root directory as the current directory | ||
root_dir=$(pwd) | ||
|
||
# Read the docs version from the keyboard | ||
previous_version=$(grep '^val publishVersion =' "$root_dir/icons-lucide/build.gradle.kts" | sed 's/^val publishVersion = "\([^\"]*\)"/\1/') | ||
|
||
read -p "🚢 Shipping version $previous_version (y/n):" confirm | ||
if [[ "$confirm" != "y" ]]; then | ||
echo "Aborted." | ||
exit 1 | ||
fi | ||
|
||
# Read the WIP version from the keyboard | ||
read -p "Enter next version (e.g., 1.8.0): " wip_version | ||
|
||
echo "Publishing to Sonar..." | ||
|
||
./gradlew publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository | ||
|
||
echo "👍 Published $previous_version" | ||
|
||
# Retrieve the last commit hash | ||
last_commit=$(git rev-parse HEAD) | ||
|
||
# Tag the last commit with the last version | ||
git tag "$previous_version" $last_commit | ||
|
||
|
||
# Find and update the version in .md files | ||
find "$root_dir" -type f -name "*.md" -exec sed -i '' "s/implementation(\"com\.composables:core:[^\"]*\")/implementation(\"com.composables:core:$previous_version\")/g" {} + | ||
|
||
# Update the publishVersion value in build.gradle.kts | ||
sed -i '' "s/^val publishVersion = \".*\"/val publishVersion = \"$wip_version\"/" "$root_dir/core/build.gradle.kts" | ||
|
||
# Add all changes to git | ||
git add . | ||
|
||
# Commit with the provided version in the message | ||
git commit -m "Prepare version $wip_version" | ||
|
||
git push origin --follow-tags | ||
|
||
echo "💯 All done. Working version is $previous_version" | ||
|
||
echo "TODO: Open a Github version for $previous_version" | ||
open https://github.com/composablehorizons/composables-core/releases/new |