-
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
66 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [[ "$CURRENT_BRANCH" == "prerelease" ]]; then | ||
echo "Cannot delete prerelease while on prerelease branch" | ||
echo "Please checkout another branch first" | ||
exit 1 | ||
fi | ||
|
||
if ! git show-ref --verify --quiet refs/heads/prerelease; then | ||
echo "No local prerelease branch found" | ||
exit 0 | ||
fi | ||
|
||
git branch -D prerelease | ||
|
||
if git ls-remote --exit-code --heads origin prerelease >/dev/null 2>&1; then | ||
git push origin --delete prerelease | ||
echo "Remote prerelease branch deleted" | ||
fi | ||
|
||
echo "Prerelease branch cleanup complete" |
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,43 @@ | ||
#!/bin/bash | ||
|
||
VERSION=$1 | ||
SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "Error: Version argument required" | ||
echo "Usage: ./create-prerelease.sh <version>" | ||
echo "Example: ./create-prerelease.sh 1.1.0" | ||
echo "" | ||
echo "This will create a prerelease branch from your current branch: $SOURCE_BRANCH" | ||
exit 1 | ||
fi | ||
|
||
echo "Updating current branch ($SOURCE_BRANCH)..." | ||
git pull origin $SOURCE_BRANCH || exit 1 | ||
|
||
echo "Creating prerelease branch from $SOURCE_BRANCH..." | ||
git checkout -b prerelease || exit 1 | ||
|
||
echo "Copying changelog..." | ||
if [ -f "CHANGELOG.md" ]; then | ||
cp CHANGELOG.md CHANGELOG-PRERELEASE.md || exit 1 | ||
git add CHANGELOG-PRERELEASE.md | ||
echo "Committing changelog..." | ||
git commit -m "chore: initialize prerelease changelog from $SOURCE_BRANCH" || exit 1 | ||
else | ||
echo "Warning: No CHANGELOG.md found in $SOURCE_BRANCH" | ||
touch CHANGELOG-PRERELEASE.md | ||
git add CHANGELOG-PRERELEASE.md | ||
git commit -m "chore: initialize empty prerelease changelog" || exit 1 | ||
fi | ||
|
||
echo "Creating release commit..." | ||
git commit --allow-empty -m "chore: release v${VERSION}-rc1 | ||
Release-As: v${VERSION}-rc1" || exit 1 | ||
|
||
echo "Pushing to remote..." | ||
git push origin prerelease || exit 1 | ||
|
||
echo "Prerelease branch setup complete!" | ||
echo "A release-please PR for v${VERSION}-rc1 should be created shortly." | ||
echo "Source branch was: $SOURCE_BRANCH" |