docs: add RELEASE_NOTES.md pattern for CI release notes
CI scans for RELEASE_NOTES.md in the repo and prepends its content to the auto-generated Downloads section in the release body.
This commit is contained in:
@@ -600,6 +600,50 @@ git tag v0.2.0-alpha.1
|
|||||||
git push origin v0.2.0-alpha.1
|
git push origin v0.2.0-alpha.1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 8.1. Release Notes from File
|
||||||
|
|
||||||
|
Instead of hardcoding release notes in the workflow, keep a `RELEASE_NOTES.md` in the repo. The CI scans for it and prepends its content to the auto-generated Downloads section.
|
||||||
|
|
||||||
|
**Workflow:**
|
||||||
|
1. Before tagging, write `RELEASE_NOTES.md` with changes for this release
|
||||||
|
2. Commit, tag, push — CI picks up the file automatically
|
||||||
|
3. Release body = your notes + auto-generated download/Docker instructions
|
||||||
|
|
||||||
|
**CI implementation:**
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
run: |
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Python reads RELEASE_NOTES from env, prepends to Downloads section
|
||||||
|
BODY_JSON=$(python3 -c "
|
||||||
|
import json, os, textwrap
|
||||||
|
notes = os.environ.get('RELEASE_NOTES', '')
|
||||||
|
sections = []
|
||||||
|
if notes.strip():
|
||||||
|
sections.append(notes.strip())
|
||||||
|
sections.append('## Downloads\n...') # auto-generated part
|
||||||
|
print(json.dumps('\n\n'.join(sections)))
|
||||||
|
")
|
||||||
|
|
||||||
|
# Create release with combined body
|
||||||
|
curl -s -X POST ... -d "{\"body\": $BODY_JSON, ...}"
|
||||||
|
```
|
||||||
|
|
||||||
|
If `RELEASE_NOTES.md` is absent, the release uses only the auto-generated Downloads section — no manual notes needed for quick pre-releases.
|
||||||
|
|
||||||
## 9. Gitea vs GitHub Actions Differences
|
## 9. Gitea vs GitHub Actions Differences
|
||||||
|
|
||||||
| Feature | GitHub Actions | Gitea Actions |
|
| Feature | GitHub Actions | Gitea Actions |
|
||||||
|
|||||||
Reference in New Issue
Block a user