From b12b9746c6fab8038aa074003fd43f8d68378f54 Mon Sep 17 00:00:00 2001 From: "dolgolyov.alexei" Date: Wed, 25 Mar 2026 15:33:34 +0300 Subject: [PATCH] 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. --- gitea-python-ci-cd.md | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gitea-python-ci-cd.md b/gitea-python-ci-cd.md index 8ccc734..152f54a 100644 --- a/gitea-python-ci-cd.md +++ b/gitea-python-ci-cd.md @@ -600,6 +600,50 @@ git tag 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 | Feature | GitHub Actions | Gitea Actions |