From 9e36986bc7fafabefdccac69271b684019dcaee8 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:57:55 +0000 Subject: [PATCH] Fix GitHub releases process (#108) --- .github/workflows/tag.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tag.sh b/.github/workflows/tag.sh index 9b69d84..be1923b 100644 --- a/.github/workflows/tag.sh +++ b/.github/workflows/tag.sh @@ -3,7 +3,15 @@ find . -maxdepth 1 -type f -name '*.nupkg' -exec sh -c 'tag=$(basename "$1" .nupkg); git tag "$tag"; git push origin "$tag"' shell {} \; export TAG -TAG=$(find . -maxdepth 1 -type f -name 'WoofWare.Myriad.Plugins.*.nupkg' -exec sh -c 'basename "$1" .nupkg' shell {} \;) +TAG=$(find . -maxdepth 1 -type f -name 'WoofWare.Myriad.Plugins.*.nupkg' -exec sh -c 'basename "$1" .nupkg' shell {} \; | grep -v Attributes) + +case "$TAG" in + *" +"*) + echo "Error: TAG contains a newline; multiple plugins found." + exit 1 + ;; +esac # target_commitish empty indicates the repo default branch curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/Smaug123/WoofWare.Myriad/releases -d '{"tag_name":"'"$TAG"'","target_commitish":"","name":"'"$TAG"'","draft":false,"prerelease":false,"generate_release_notes":false}'