Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions dev-bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

set -eu -o pipefail

# Check that we're not on the main branch
current_branch=$(git branch --show-current)
if [ "$current_branch" = "main" ]; then
echo "Error: Releases should not be done directly on the main branch."
echo "Please create a release branch and run this script from there."
exit 1
fi

# Fetch latest changes and check that we're not behind origin/main
echo "Fetching from origin..."
git fetch origin

if ! git merge-base --is-ancestor origin/main HEAD; then
echo "Error: Current branch is behind origin/main."
echo "Please merge or rebase with origin/main before releasing."
exit 1
fi

changelog=$(cat HISTORY.rst)

regex='
Expand Down
Loading