mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 03:23:56 -07:00
Harmonize beta and assign true/false value, Capitalize print messages
This commit is contained in:
parent
fb74e8fd97
commit
b768c27c4c
1 changed files with 16 additions and 15 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
# adds output to GITHUB_OUTPUT
|
# adds output to GITHUB_OUTPUT
|
||||||
template_path=".ci/release_template.md"
|
template_path=".ci/release_template.md"
|
||||||
body_path="/tmp/release.md"
|
body_path="/tmp/release.md"
|
||||||
beta_regex='beta'
|
beta_regex='-beta'
|
||||||
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
||||||
whitespace='^\s*$'
|
whitespace='^\s*$'
|
||||||
|
|
||||||
|
|
@ -23,28 +23,29 @@ fi
|
||||||
|
|
||||||
# create title
|
# create title
|
||||||
if [[ $TAG =~ $beta_regex ]]; then
|
if [[ $TAG =~ $beta_regex ]]; then
|
||||||
echo "is_beta=true" >>"$GITHUB_OUTPUT"
|
beta=true
|
||||||
|
echo "beta=$beta" >>"$GITHUB_OUTPUT"
|
||||||
title="$TAG"
|
title="$TAG"
|
||||||
echo "creating beta release '$title'"
|
echo "Creating beta release '$title'"
|
||||||
elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then
|
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
|
exit 1
|
||||||
else
|
else
|
||||||
echo "is_beta=false" >>"$GITHUB_OUTPUT"
|
beta=false
|
||||||
|
echo "beta=$beta" >>"$GITHUB_OUTPUT"
|
||||||
name="${BASH_REMATCH[1]}"
|
name="${BASH_REMATCH[1]}"
|
||||||
version="${TAG##*-}"
|
version="${TAG##*-}"
|
||||||
title="Cockatrice $version: $name"
|
title="Cockatrice $version: $name"
|
||||||
no_beta=true
|
|
||||||
echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
|
echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
|
||||||
echo "creating full release '$title'"
|
echo "Creating full release '$title'"
|
||||||
fi
|
fi
|
||||||
echo "title=$title" >>"$GITHUB_OUTPUT"
|
echo "title=$title" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# add release notes template
|
# add release notes template
|
||||||
if [[ $no_beta ]]; then
|
if [[ $beta == "false" ]]; then
|
||||||
body="$(cat "$template_path")"
|
body="$(cat "$template_path")"
|
||||||
if [[ ! $body ]]; then
|
if [[ ! $body ]]; then
|
||||||
echo "::warning file=$0::could not find release template"
|
echo "::warning file=$0::Could not find release template"
|
||||||
fi
|
fi
|
||||||
body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}"
|
body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}"
|
||||||
else
|
else
|
||||||
|
|
@ -64,13 +65,13 @@ before="${all_tags%%
|
||||||
"$TAG"*}" # strip line with current tag an all lines after it
|
"$TAG"*}" # strip line with current tag an all lines after it
|
||||||
# note the extra newlines are needed to always have a last line
|
# note the extra newlines are needed to always have a last line
|
||||||
if [[ $all_tags == "$before" ]]; then
|
if [[ $all_tags == "$before" ]]; then
|
||||||
echo "::warning file=$0::could not find current tag"
|
echo "::warning file=$0::Could not find current tag"
|
||||||
else
|
else
|
||||||
while
|
while
|
||||||
previous="${before##*
|
previous="${before##*
|
||||||
}" # get the last line
|
}" # get the last line
|
||||||
# skip this tag if this is a full release and it's a beta or if empty
|
# 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
|
do
|
||||||
beta_list+=" $previous" # add to list of skipped betas
|
beta_list+=" $previous" # add to list of skipped betas
|
||||||
next_before="${before%
|
next_before="${before%
|
||||||
|
|
@ -85,7 +86,7 @@ else
|
||||||
if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then
|
if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then
|
||||||
count="$(git rev-list --count "$previous..$TAG")"
|
count="$(git rev-list --count "$previous..$TAG")"
|
||||||
[[ $previous =~ $beta_regex ]] && previousreleasetype="beta release" || previousreleasetype="full release"
|
[[ $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)"
|
echo "'$previous' to '$TAG' ($count commits)"
|
||||||
# --> is the markdown comment escape sequence, emojis are way better
|
# --> is the markdown comment escape sequence, emojis are way better
|
||||||
generated_list="${generated_list//-->/→}"
|
generated_list="${generated_list//-->/→}"
|
||||||
|
|
@ -98,15 +99,15 @@ else
|
||||||
if [[ $beta_list =~ $whitespace ]]; then
|
if [[ $beta_list =~ $whitespace ]]; then
|
||||||
beta_list="-n there are no betas to delete!"
|
beta_list="-n there are no betas to delete!"
|
||||||
else
|
else
|
||||||
echo "the following betas should be deleted after publishing:"
|
echo "The following betas should be deleted after publishing:"
|
||||||
echo "$beta_list"
|
echo "$beta_list"
|
||||||
fi
|
fi
|
||||||
body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}"
|
body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}"
|
||||||
else
|
else
|
||||||
echo "::warning file=$0::failed to produce git log"
|
echo "::warning file=$0::Failed to produce git log"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "::warning file=$0::could not find previous tag"
|
echo "::warning file=$0::Could not find previous tag"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue