docs: update release notes pattern to use sparse-checkout
Replace full checkout + find scan with sparse-checkout for RELEASE_NOTES.md — faster and simpler.
This commit is contained in:
+10
-7
@@ -633,7 +633,7 @@ git push origin v0.2.0-alpha.1
|
|||||||
|
|
||||||
### 8.1. Release Notes from File
|
### 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.
|
Instead of hardcoding release notes in the workflow, keep a `RELEASE_NOTES.md` in the repo root. The CI fetches only that file (via sparse-checkout for speed) and prepends its content to the auto-generated Downloads section.
|
||||||
|
|
||||||
**Workflow:**
|
**Workflow:**
|
||||||
1. Before tagging, write `RELEASE_NOTES.md` with changes for this release
|
1. Before tagging, write `RELEASE_NOTES.md` with changes for this release
|
||||||
@@ -643,16 +643,17 @@ Instead of hardcoding release notes in the workflow, keep a `RELEASE_NOTES.md` i
|
|||||||
**CI implementation:**
|
**CI implementation:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Checkout
|
- name: Fetch RELEASE_NOTES.md only
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
sparse-checkout: RELEASE_NOTES.md
|
||||||
|
sparse-checkout-cone-mode: false
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
run: |
|
run: |
|
||||||
# Scan for RELEASE_NOTES.md (repo root first, then up to 3 levels deep)
|
if [ -f RELEASE_NOTES.md ]; then
|
||||||
NOTES_FILE=$(find . -maxdepth 3 -name "RELEASE_NOTES.md" -type f | head -1)
|
export RELEASE_NOTES=$(cat RELEASE_NOTES.md)
|
||||||
if [ -n "$NOTES_FILE" ]; then
|
echo "Found RELEASE_NOTES.md"
|
||||||
export RELEASE_NOTES=$(cat "$NOTES_FILE")
|
|
||||||
echo "Found release notes: $NOTES_FILE"
|
|
||||||
else
|
else
|
||||||
export RELEASE_NOTES=""
|
export RELEASE_NOTES=""
|
||||||
echo "No RELEASE_NOTES.md found"
|
echo "No RELEASE_NOTES.md found"
|
||||||
@@ -673,6 +674,8 @@ Instead of hardcoding release notes in the workflow, keep a `RELEASE_NOTES.md` i
|
|||||||
curl -s -X POST ... -d "{\"body\": $BODY_JSON, ...}"
|
curl -s -X POST ... -d "{\"body\": $BODY_JSON, ...}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Why sparse-checkout?** The `create-release` job only needs one file. A sparse-checkout skips downloading the full repo history and working tree, making the step significantly faster — especially in repos with large static assets or many files.
|
||||||
|
|
||||||
If `RELEASE_NOTES.md` is absent, the release uses only the auto-generated Downloads section — no manual notes needed for quick pre-releases.
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user