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
37 changes: 31 additions & 6 deletions github-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env -S bash -e


function usage() {
echo "Usage:"
echo
Expand All @@ -13,8 +12,11 @@ function usage() {
echo
echo " -h Show this help and exit."
echo " -d Dry run; do not push, deploy or publish anything."
echo " --notes=file Specifies an optional file which contains 'release notes' to include in the release announcement"
}

function needs_arg() { if [ -z "$OPTARG" ]; then die "No arg for --$opt option"; fi; }

#--------------------------------------------
# Option parsing

Expand All @@ -23,7 +25,17 @@ function exec_or_dry_run() {
}
PUSH_CHANGES=true

while getopts 'dhb:' opt; do
notesFile=""
while getopts 'dhb:-:' opt; do
if [ "$opt" = "-" ]; then
# long option: reformulate opt and OPTARG
# - extract long option name
opt="${OPTARG%%=*}"
# - extract long option argument (may be empty)
OPTARG="${OPTARG#"$opt"}"
# - remove assigning `=`
OPTARG="${OPTARG#=}"
fi
case "$opt" in
h)
usage
Expand All @@ -37,6 +49,11 @@ while getopts 'dhb:' opt; do
echo "DRY RUN; would have executed:" "${@}"
}
;;
notes)
needs_arg
notesFile="$OPTARG"
echo "Using external notes-file : $notesFile"
;;
\?)
usage
exit 1
Expand Down Expand Up @@ -110,16 +127,24 @@ introGuideUrl="${docsUrl}/introduction/html_single/Hibernate_Introduction.html"
userGuideUrl="${docsUrl}/userguide/html_single/Hibernate_User_Guide.html"

releaseName="Hibernate ${PROJECT_NAME} ${RELEASE_VERSION}"

notesContent=""
if [ -f $notesFile ]; then
notesContent=$(cat "$notesFile")
else
notesContent="This release introduces a few minor improvements as well as bug fixes."
fi

releaseBody="""\
# Hibernate ${PROJECT_NAME} ${RELEASE_VERSION} released

Today, we published a new maintenance release of Hibernate ${PROJECT_NAME} ${RELEASE_VERSION_FAMILY}: ${RELEASE_VERSION}.
Today, we published a new release of Hibernate ${PROJECT_NAME} ${RELEASE_VERSION_FAMILY}: ${RELEASE_VERSION}.

## What's new
You can find the full list of ${RELEASE_VERSION} changes [here](https://hibernate.atlassian.net/issues/?jql=project%20%3D%20${JIRA_KEY}%20AND%20fixVersion%20%3D%20${TAG_NAME}).

This release introduces a few minor improvements as well as bug fixes.
## What's new

You can find the full list of ${RELEASE_VERSION} changes [here](https://hibernate.atlassian.net/issues/?jql=project%20%3D%20${JIRA_KEY}%20AND%20fixVersion%20%3D%20${TAG_NAME}).
${notesContent}

## Conclusion

Expand Down