2023-08-31 11:52:11 -07:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
ROOT=$(pwd)
|
|
|
|
|
|
2026-04-30 09:25:23 -07:00
|
|
|
TAG="$GITHUB_REF_NAME"
|
|
|
|
|
# Tags are pushed with a leading "v" (see tag.sh); strip for the changelog
|
|
|
|
|
# lookup and the upload.php version field, but use TAG for gh release create.
|
|
|
|
|
VER="${TAG#v}"
|
2026-01-10 13:52:42 -08:00
|
|
|
|
|
|
|
|
# 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" '
|
2026-01-10 15:14:34 -08:00
|
|
|
BEGIN { found=0; printing=0; pattern="^"ver":?$" }
|
|
|
|
|
$0 ~ pattern { found=1; printing=1; next }
|
2026-01-10 13:52:42 -08:00
|
|
|
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
|
|
|
|
|
|
2026-04-29 13:23:23 -07:00
|
|
|
ASSETS=(
|
|
|
|
|
"./Binaries Linux"/*.deb
|
|
|
|
|
"./Binaries Windows"/*.exe
|
|
|
|
|
"./Binaries macOS"/*.pkg
|
|
|
|
|
)
|
|
|
|
|
if [ -f "./Binaries macOS/Symbols_Mac.zip" ]; then
|
|
|
|
|
ASSETS+=("./Binaries macOS/Symbols_Mac.zip")
|
|
|
|
|
fi
|
|
|
|
|
|
2026-04-30 09:25:23 -07:00
|
|
|
gh release create "$TAG" --title "$TAG" -F /tmp/release_notes.txt "${ASSETS[@]}"
|
2026-04-29 13:23:23 -07:00
|
|
|
|
2026-04-30 06:51:21 -07:00
|
|
|
PLUGIN=wavetable
|
2026-04-29 13:23:23 -07:00
|
|
|
for f in "./Binaries Linux"/*.deb \
|
|
|
|
|
"./Binaries Windows"/*.exe \
|
|
|
|
|
"./Binaries macOS"/*.pkg; do
|
2026-04-30 09:25:23 -07:00
|
|
|
curl -sS --fail-with-body -F "files=@${f}" \
|
2026-04-30 06:51:21 -07:00
|
|
|
-F "plugin=${PLUGIN}" \
|
|
|
|
|
-F "version=${VER}" \
|
|
|
|
|
-F "changelog=${NOTES}" \
|
|
|
|
|
"https://socalabs.com/files/upload.php?key=$APIKEY"
|
2026-04-29 13:23:23 -07:00
|
|
|
done
|