-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·26 lines (20 loc) · 798 Bytes
/
release.sh
File metadata and controls
executable file
·26 lines (20 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash -e
set -x
cd "$(dirname "$0")"
ROOT=$(pwd)
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; pattern="^"ver":?$" }
$0 ~ pattern { 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" --title "$VER" -F /tmp/release_notes.txt ./Binaries\ Linux/*.zip ./Binaries\ Windows/*.zip ./Binaries\ macOS/*.zip