From e45fa11b8f965dd5bd988e153b1bf434b08b2dd9 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Wed, 26 Aug 2026 11:18:51 -0400 Subject: [PATCH] chore(release): build release notes from a changelog publish.yml created the GitHub release with --generate-notes, which lists merged PR titles. For a contract package that says nothing useful: 0.1.0 released with a body that was only a "Full Changelog" link, so a consumer reading it could not tell what was in the API. Release notes now come from a CHANGELOG.md section matching the published version, written in the PR that syncs the contract while the diff is still at hand. A version with no section fails the publish, and it fails before the upload, since Maven Central will not take a version number twice. Mirrors the same change in ocp-client-protocol, keeping the two publish workflows identical apart from names and coordinates. --- .github/workflows/publish.yml | 19 ++++++++++++++++++- .gitignore | 3 +++ CHANGELOG.md | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c5e01bc..8d8a055 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,6 +50,23 @@ jobs: exit 1 fi + # The release notes come from CHANGELOG.md, not from generated commit titles, so a + # missing entry is a missing release note. Fail here rather than after the upload. + - name: Extract the release notes + run: | + set -euo pipefail + awk -v ver="${{ inputs.version }}" ' + $0 == "## " ver { found = 1; next } + found && /^## / { exit } + found { print } + ' CHANGELOG.md > release-notes.md + if [ ! -s release-notes.md ]; then + echo "::error::CHANGELOG.md has no '## ${{ inputs.version }}' section. Add one describing the contract change before publishing." + exit 1 + fi + echo "Release notes for ${{ inputs.version }}:" + cat release-notes.md + - name: Validate Gradle wrapper uses: gradle/actions/wrapper-validation@v4 @@ -122,7 +139,7 @@ jobs: run: | gh release create "${{ inputs.version }}" \ --title "${{ inputs.version }}" \ - --generate-notes + --notes-file release-notes.md - name: Summary run: | diff --git a/.gitignore b/.gitignore index b4512fa..496a131 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ local.properties # Pinned codegen toolchain, installed by scripts/install-swift-toolchain.sh. .tools/ + +# Written by publish.yml when it extracts release notes from CHANGELOG.md +release-notes.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1935aa9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog + +Contract changes from a consumer's point of view: what appeared, what changed shape, and what breaks +if you upgrade. Field and enum renumbering matters more than its diff size suggests, so it gets +called out explicitly even when nothing else did. + +`publish.yml` reads the section matching the version it is publishing and uses it as the GitHub +release notes, so a version with no entry here does not release. Write the entry in the same PR that +syncs the contract, while the diff is still in front of you. + +## 0.1.0 + +First release. The Flipcash contract is now generated once here and published for both platforms, +replacing the copies each app vendored and generated for itself. + +- Kotlin, on Maven Central as `com.flipcash:flipcash2-client-protocol`, under + `com.codeinc.flipcash.gen.*`. +- Swift, as the `Flipcash2ClientProtocol` module. The git tag is the SPM release.