Update tag and release scripts

This commit is contained in:
Roland Rabien 2026-01-10 13:52:42 -08:00
commit 6c0dc53509
2 changed files with 27 additions and 1 deletions

View file

@ -4,4 +4,23 @@ set -x
cd "$(dirname "$0")"
ROOT=$(pwd)
gh release create "$GITHUB_REF_NAME" -F ./Changelist.txt ./Binaries\ Linux/*.zip ./Binaries\ Windows/*.zip ./Binaries\ macOS/*.zip
VER="$GITHUB_REF_NAME"
# Extract the changelog section for the current version
# Matches version with optional colon, captures until the next version line or EOF
NOTES=$(awk -v ver="$VER" '
BEGIN { found=0; printing=0 }
$0 ~ "^"ver":?"$ { found=1; printing=1; next }
printing && /^[0-9]+\.[0-9]+\.[0-9]+:?$/ { printing=0 }
printing { print }
END { if (!found) exit 1 }
' ./Changelist.txt)
if [ $? -ne 0 ] || [ -z "$NOTES" ]; then
echo "Error: Version $VER not found in Changelist.txt or has no content"
exit 1
fi
echo "$NOTES" > /tmp/release_notes.txt
gh release create "$VER" -F /tmp/release_notes.txt ./Binaries\ Linux/*.zip ./Binaries\ Windows/*.zip ./Binaries\ macOS/*.zip

7
tag.sh
View file

@ -6,5 +6,12 @@ ROOT=$(pwd)
cd $ROOT
VER=`cat VERSION`
# Check that the version exists in the Changelist.txt
if ! grep -q "^${VER}:*$" Changelist.txt; then
echo "Error: Version $VER not found in Changelist.txt"
exit 1
fi
echo "Tagging [$VER]"
git tag "$VER" && git push origin "$VER"