ci: embed RELEASE_NOTES.md in Gitea release body
This commit is contained in:
@@ -27,17 +27,38 @@ jobs:
|
|||||||
IS_PRE="true"
|
IS_PRE="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Scan for RELEASE_NOTES.md (repo root first, then up to 3 levels deep)
|
||||||
|
NOTES_FILE=$(find . -maxdepth 3 -name "RELEASE_NOTES.md" -type f | head -1)
|
||||||
|
if [ -n "$NOTES_FILE" ]; then
|
||||||
|
export RELEASE_NOTES=$(cat "$NOTES_FILE")
|
||||||
|
echo "Found release notes: $NOTES_FILE"
|
||||||
|
else
|
||||||
|
export RELEASE_NOTES=""
|
||||||
|
echo "No RELEASE_NOTES.md found"
|
||||||
|
fi
|
||||||
|
|
||||||
BODY_JSON=$(python3 -c "
|
BODY_JSON=$(python3 -c "
|
||||||
import json, textwrap
|
import json, os, textwrap
|
||||||
|
|
||||||
tag = '$TAG'
|
tag = '$TAG'
|
||||||
body = f'''## Downloads
|
release_notes = os.environ.get('RELEASE_NOTES', '')
|
||||||
|
|
||||||
|
sections = []
|
||||||
|
|
||||||
|
if release_notes.strip():
|
||||||
|
sections.append(release_notes.strip())
|
||||||
|
|
||||||
|
sections.append(textwrap.dedent(f'''
|
||||||
|
## Downloads
|
||||||
|
|
||||||
| Platform | File |
|
| Platform | File |
|
||||||
|----------|------|
|
|----------|------|
|
||||||
| Windows (installer) | \`MediaServer-{tag}-setup.exe\` |
|
| Windows (installer) | \`MediaServer-{tag}-setup.exe\` |
|
||||||
| Windows (portable) | \`MediaServer-{tag}-win-x64.zip\` |
|
| Windows (portable) | \`MediaServer-{tag}-win-x64.zip\` |
|
||||||
| Linux | \`MediaServer-{tag}-linux-x64.tar.gz\` |
|
| Linux | \`MediaServer-{tag}-linux-x64.tar.gz\` |
|
||||||
'''
|
''').strip())
|
||||||
print(json.dumps(textwrap.dedent(body).strip()))
|
|
||||||
|
print(json.dumps('\n\n'.join(sections)))
|
||||||
")
|
")
|
||||||
|
|
||||||
RELEASE=$(curl -s -X POST "$BASE_URL/releases" \
|
RELEASE=$(curl -s -X POST "$BASE_URL/releases" \
|
||||||
|
|||||||
Reference in New Issue
Block a user