From c4f3196b2733a32ea595445be86a128c2608cf52 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 11 Sep 2024 18:20:56 +0200 Subject: [PATCH] chore: get Github release notes from command line So we can integrate the changelog in the release, instead of having a commit after the release. You need to have a GITHUB_TOKEN env var, with a read only bearer coming from https://github.com/settings/tokens --- Makefile | 4 ++++ docs/release.md | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c84fc1ea..83506ddc 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,10 @@ tx_push: tx push -s tx_pull: tx pull +changelog: + $(eval VERSION=$(shell hatch version)) + @# Bearer token is readonly + @printf $(shell curl -sL -X POST -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/umap-project/umap/releases/generate-notes -d '{"target_commitish":"master","previous_tag_name":"", "tag_name": "${VERSION}"}' | jq .body | sed 's/https:\/\/github.com\/umap-project\/umap\/pull\//#/g') jsdir = umap/static/umap/js/ filepath = "${jsdir}*.js" diff --git a/docs/release.md b/docs/release.md index df9284e5..39d744b7 100644 --- a/docs/release.md +++ b/docs/release.md @@ -22,10 +22,11 @@ - commit new translations `git commit -am "i18n"` 2. Test collectstatic: `umap collectstatic --no-input` 2. Bump version: `make patch|minor` +2. Ask automatic release notes to Github: `make changelog` and paste it in `docs/changelog.md` 3. `git commit -am "2.X.Y"` 4. `git tag 2.X.Y` 5. `git push && git push --tag` -6. Go to [Github release page](https://github.com/umap-project/umap/releases/new) and Generate release notes + paste it in `docs/changelog.md` + finish Github process for a new release +6. Go to [Github release page](https://github.com/umap-project/umap/releases/new) and paste release notes 7. Commit the changelog `git commit -am "changelog"` 8. `make build` 9. `make publish`