Skip to content

Commit 67cacf3

Browse files
Merge pull request #27 from umage-ai/feature/release-notes-from-md
Source release notes from RELEASE-NOTES.md
2 parents b92499b + 2d65167 commit 67cacf3

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,27 @@ jobs:
3232
id: version
3333
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
3434

35-
- name: Generate release notes from merged PRs
36-
env:
37-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Resolve release notes
3836
run: |
39-
gh api repos/${{ github.repository }}/releases/generate-notes \
40-
-f tag_name=${{ github.ref_name }} \
41-
-f target_commitish=${{ github.sha }} \
42-
--jq .body > release-notes.md
37+
# Carve out the section in RELEASE-NOTES.md whose heading matches
38+
# this tag (e.g. "## v0.1.0"). The section runs until the next
39+
# "## " heading or EOF. The release fails if no matching section
40+
# is found — the curated body is the source of truth for the
41+
# GitHub release and the .nupkg's PackageReleaseNotes, so we'd
42+
# rather block the publish than silently ship without it.
43+
awk -v ver="${GITHUB_REF_NAME}" '
44+
$0 ~ "^## " ver "([[:space:]]|$)" { in_section = 1; next }
45+
in_section && /^## / { exit }
46+
in_section { print }
47+
' RELEASE-NOTES.md > release-notes.md
48+
49+
if ! grep -q '[^[:space:]]' release-notes.md; then
50+
echo "::error file=RELEASE-NOTES.md::No '## ${GITHUB_REF_NAME}' section found in RELEASE-NOTES.md."
51+
echo "Add the section, commit, delete + recreate the tag at the new commit, then re-push."
52+
exit 1
53+
fi
54+
55+
echo "Using curated '## ${GITHUB_REF_NAME}' section from RELEASE-NOTES.md."
4356
echo "::group::Release notes"
4457
cat release-notes.md
4558
echo "::endgroup::"

CLAUDE.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ is unused for static file serving.
6161
confirm first.)
6262
- Pre-release local verification: `dotnet test` (no `--no-build` — that flag silently uses
6363
stale test DLLs and can miss compile errors introduced by signature changes).
64-
- `RELEASE-NOTES.md` at the repo root is a hand-curated, human-readable changelog. Update it
65-
in the same PR that introduces user-visible changes. The workflow's auto-generated notes
66-
(from PR titles between tags) handle the GitHub release body and `.nupkg`
67-
`PackageReleaseNotes` field separately — `RELEASE-NOTES.md` itself is not read by CI.
64+
- `RELEASE-NOTES.md` at the repo root is a hand-curated, human-readable changelog and is
65+
**the source of truth for the release body and the `.nupkg` `PackageReleaseNotes`
66+
field**. The publish workflow carves out the `## v<version>` section matching the
67+
pushed tag and uses it verbatim. **No matching section → the workflow fails before
68+
build**, so the nupkg never ships without a curated body. Update `RELEASE-NOTES.md`
69+
in the same PR that introduces user-visible changes.
70+
- **Before tagging a release, verify `RELEASE-NOTES.md` has an up-to-date
71+
`## v<next-version>` section** covering everything merged since the previous tag.
72+
If you skip this and CI fails on the tag, the recovery is: add the section, commit,
73+
delete + recreate the tag at the new commit, re-push.
6874

6975
## Key Patterns (inherited from EditorPowertools framework)
7076

0 commit comments

Comments
 (0)