fix gitea workflow bug
This commit is contained in:
parent
99c20fa8de
commit
12c615b62c
@ -95,6 +95,12 @@ jobs:
|
|||||||
# Get the tag message
|
# Get the tag message
|
||||||
TAG_MESSAGE=$(git tag -l --format='%(contents)' ${VERSION})
|
TAG_MESSAGE=$(git tag -l --format='%(contents)' ${VERSION})
|
||||||
|
|
||||||
|
# Create release body
|
||||||
|
RELEASE_BODY=$(printf "%s\n\n## Downloads\n\n### Linux\n- **AppImage**: Portable, single-file executable (no installation needed)\n- **Tarball**: Extract and run \`sudo ./install.sh\` to install\n\n### Windows\n- **Zip**: Extract and run \`NotePad.exe\`" "$TAG_MESSAGE")
|
||||||
|
|
||||||
|
# Escape the full body for JSON
|
||||||
|
RELEASE_BODY_JSON=$(printf '%s' "$RELEASE_BODY" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||||
|
|
||||||
# Create release
|
# Create release
|
||||||
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
|
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
@ -102,7 +108,7 @@ jobs:
|
|||||||
-d "{
|
-d "{
|
||||||
\"tag_name\": \"${VERSION}\",
|
\"tag_name\": \"${VERSION}\",
|
||||||
\"name\": \"NotePad ${VERSION}\",
|
\"name\": \"NotePad ${VERSION}\",
|
||||||
\"body\": \"${TAG_MESSAGE}\n\n## Downloads\n\n### Linux\n- **AppImage**: Portable, single-file executable (no installation needed)\n- **Tarball**: Extract and run \`sudo ./install.sh\` to install\n\n### Windows\n- **Zip**: Extract and run \`NotePad.exe\`\"
|
\"body\": \"${RELEASE_BODY_JSON}\"
|
||||||
}" > release_response.json
|
}" > release_response.json
|
||||||
|
|
||||||
RELEASE_ID=$(cat release_response.json | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
|
RELEASE_ID=$(cat release_response.json | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user