Skip to content

Commit

Permalink
fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
cakemanny committed Feb 4, 2024
1 parent 2c65ab0 commit fb82dcf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ set -o pipefail
cd "$(dirname "$0")/.."

latest_version() {
fgrep -n '## [' "$1" | grep -o '[0-9]+\.[0-9]+\.[0-9]+' | head -1
grep -F -n '## [' "$1" | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+' | head -1
}

new_version() {
latest=$(latest_version CHANGELOG.md)

unreleased_changes=$(sed -n '/## \[Unreleased/,/^## /p' CHANGELOG.md)

if echo "$unreleased_changes" | fgrep -q '### Added'; then
if echo "$unreleased_changes" | grep -F -q '### Added'; then
echo "$latest" | awk -F . '{ print $1 "." ($2 + 1) ".0" }'
return
fi
if echo "$unreleased_changes" | fgrep -q '### Fixed'; then
if echo "$unreleased_changes" | grep -F -q '### Fixed'; then
echo "$latest" | awk -F . '{ print $1 "." $2 "." ($3 + 1) }'
return
fi
Expand All @@ -43,11 +43,11 @@ main() {
./scripts/version_changelog

# TODO: Adjust for dirtiness
sed -e 's/VERSION = .*/VERSION = "'$v'"/' -i '' setup.py
sed -e 's/VERSION = .*/VERSION = "'"$v"'"/' -i '' setup.py

if [ "$(git rev-parse HEAD)" != "$(git rev-parse HEAD)" ]; then
if [ "$(git rev-parse HEAD)" != "$(git rev-parse master)" ]; then
echo "not on master"
exit
exit 1
fi

if ! git rev-parse v"$v" 2>/dev/null; then
Expand Down

0 comments on commit fb82dcf

Please sign in to comment.