Skip to content

Commit

Permalink
handle beta releases
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Jan 6, 2025
1 parent 89e426f commit 98bbf47
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function generate {
LATEST_VERSION=$(npx -y changie@$CHANGIE_VERSION latest -r --skip-prereleases)
COMPLETE_VERSION="$LATEST_VERSION-dev"


npx -y changie@$CHANGIE_VERSION merge -u "## $LATEST_VERSION (Unreleased)"

# If we have no changes yet, the changelog is empty now, so we need to add a header
Expand All @@ -61,6 +60,17 @@ function generate {
HUMAN_DATE=$(date +"%B %d, %Y") # Date in Janurary 1st, 2022 format
COMPLETE_VERSION="$LATEST_VERSION-$PRERELEASE_VERSION"

npx -y changie@$CHANGIE_VERSION merge -u "## $COMPLETE_VERSION ($HUMAN_DATE)"
;;

beta)
LATEST_VERSION=$(npx -y changie@$CHANGIE_VERSION latest -r --skip-prereleases)
# We need to check if this is the first RC of the version
BETA_NUMBER=$(git tag -l "v$LATEST_VERSION-beta*" | wc -l)
BETA_NUMBER=$((BETA_NUMBER + 1))
HUMAN_DATE=$(date +"%B %d, %Y") # Date in Janurary 1st, 2022 format
COMPLETE_VERSION="$LATEST_VERSION-beta$BETA_NUMBER"

npx -y changie@$CHANGIE_VERSION merge -u "## $COMPLETE_VERSION ($HUMAN_DATE)"
;;

Expand All @@ -74,14 +84,14 @@ function generate {

npx -y changie@$CHANGIE_VERSION merge -u "## $COMPLETE_VERSION ($HUMAN_DATE)"
;;

patch)
COMPLETE_VERSION=$(npx -y changie@$CHANGIE_VERSION next patch)
COMPLETE_VERSION=${COMPLETE_VERSION:1} # remove the v prefix
npx -y changie@$CHANGIE_VERSION batch patch
npx -y changie@$CHANGIE_VERSION merge
;;

release)
# This is the first release of the branch, releasing the new minor version
COMPLETE_VERSION=$(npx -y changie@$CHANGIE_VERSION latest -r --skip-prereleases)
Expand Down

0 comments on commit 98bbf47

Please sign in to comment.