From b768c27c4c6e7d82a539f5bea0684881d6be1f19 Mon Sep 17 00:00:00 2001 From: tooomm Date: Mon, 29 Jun 2026 13:32:03 +0200 Subject: [PATCH] Harmonize beta and assign true/false value, Capitalize print messages --- .ci/prep_release.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.ci/prep_release.sh b/.ci/prep_release.sh index 8e830bb23..626f4c968 100755 --- a/.ci/prep_release.sh +++ b/.ci/prep_release.sh @@ -7,7 +7,7 @@ # adds output to GITHUB_OUTPUT template_path=".ci/release_template.md" body_path="/tmp/release.md" -beta_regex='beta' +beta_regex='-beta' name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")' whitespace='^\s*$' @@ -23,28 +23,29 @@ fi # create title if [[ $TAG =~ $beta_regex ]]; then - echo "is_beta=true" >>"$GITHUB_OUTPUT" + beta=true + echo "beta=$beta" >>"$GITHUB_OUTPUT" title="$TAG" - echo "creating beta release '$title'" + echo "Creating beta release '$title'" elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then - echo "::error file=$0::could not find releasename in CMakeLists.txt" + echo "::error file=$0::Could not find releasename in CMakeLists.txt" exit 1 else - echo "is_beta=false" >>"$GITHUB_OUTPUT" + beta=false + echo "beta=$beta" >>"$GITHUB_OUTPUT" name="${BASH_REMATCH[1]}" version="${TAG##*-}" title="Cockatrice $version: $name" - no_beta=true echo "friendly_name=$name" >>"$GITHUB_OUTPUT" - echo "creating full release '$title'" + echo "Creating full release '$title'" fi echo "title=$title" >>"$GITHUB_OUTPUT" # add release notes template -if [[ $no_beta ]]; then +if [[ $beta == "false" ]]; then body="$(cat "$template_path")" if [[ ! $body ]]; then - echo "::warning file=$0::could not find release template" + echo "::warning file=$0::Could not find release template" fi body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}" else @@ -64,13 +65,13 @@ before="${all_tags%% "$TAG"*}" # strip line with current tag an all lines after it # note the extra newlines are needed to always have a last line if [[ $all_tags == "$before" ]]; then - echo "::warning file=$0::could not find current tag" + echo "::warning file=$0::Could not find current tag" else while previous="${before##* }" # get the last line # skip this tag if this is a full release and it's a beta or if empty - [[ $no_beta && $previous =~ $beta_regex || ! $previous ]] + [[ $beta == "false" && $previous =~ $beta_regex || ! $previous ]] do beta_list+=" $previous" # add to list of skipped betas next_before="${before% @@ -85,7 +86,7 @@ else if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then count="$(git rev-list --count "$previous..$TAG")" [[ $previous =~ $beta_regex ]] && previousreleasetype="beta release" || previousreleasetype="full release" - echo "adding list of commits to release notes:" + echo "Adding list of commits to release notes:" echo "'$previous' to '$TAG' ($count commits)" # --> is the markdown comment escape sequence, emojis are way better generated_list="${generated_list//-->/→}" @@ -98,15 +99,15 @@ else if [[ $beta_list =~ $whitespace ]]; then beta_list="-n there are no betas to delete!" else - echo "the following betas should be deleted after publishing:" + echo "The following betas should be deleted after publishing:" echo "$beta_list" fi body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}" else - echo "::warning file=$0::failed to produce git log" + echo "::warning file=$0::Failed to produce git log" fi else - echo "::warning file=$0::could not find previous tag" + echo "::warning file=$0::Could not find previous tag" fi fi