ci: automate the creation of the draft GitHub release (#303)

Provide a template that will ease the GitHub release writing.
This will also ensure that the content of all release notes is
consistent.
development
Thomas Bouffard 2024-01-10 06:41:09 +01:00 committed by GitHub
parent 2cd17f1a3e
commit 7c94e0c3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 17 deletions

View File

@ -0,0 +1,71 @@
name: Create GitHub release
on:
push:
tags:
- v*
jobs:
create_release:
runs-on: ubuntu-22.04
permissions:
contents: write # create the GH release
steps:
- name: Set env
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Create release
uses: ncipollo/release-action@v1
with:
body: |
**Adapt this one liner summary**
⚡ This new version improves ... ⚡
_If appropriate, briefly explain the contents of the new version._
npm package: [${{ env.VERSION }}](https://www.npmjs.com/package/@maxgraph/core/v/${{ env.VERSION }})
**Update the milestone URL**
Issues: [milestone ${{ env.VERSION }}](https://github.com/maxGraph/maxGraph/milestone/x?closed=1)
See also the [Changelog](https://github.com/maxGraph/maxGraph/tree/${{ env.VERSION }}/CHANGELOG.md) file.
## Breaking changes
**TODO: keep if relevant and follow the guidelines below**
- explain why it is introduced
- explain the impact (use case, usage, impact a lot of user or only few, ....)
- add references to issue or pull request to help users to understand the breaking change
### Removal of deprecated API
**TODO: keep if relevant and follow the guidelines below**
- list API
- add reference to the version and release notes where it was announced as "deprecated"
## Deprecated APIs
**TODO: keep if relevant and follow the guidelines below**
- list the APIs
- explain why they are deprecated
- provide the new API to use instead. If none exist, mention it
- explain in which version it will be removed. We usually keep 3 minor versions prior removal.
- ensure that an issue exists to track the removal (one by version is OK) and it is attached to a milestone related to the version
## Highlights
_Note_: use [release 0.5.0](https://github.com/maxGraph/maxGraph/releases/tag/v0.5.0) and [release 0.6.0](https://github.com/maxGraph/maxGraph/releases/tag/v0.6.0) as examples
**Add screenshots, animations or videos to make your description more user-friendly!**
### Change 1
some explanations....
For more details, see #<PR_NUMBER>.
### Other changes.... adapt and create more paragraphs
draft: true
generateReleaseNotes: true
name: ${{ env.VERSION }}

View File

@ -63,26 +63,17 @@ git tag v0.2.0
## Create the GitHub release
**Example**: Use the [maxGraph 0.1.0 release](https://github.com/maxGraph/maxGraph/releases/tag/v0.1.0) for inspiration
The release workflow has initiated a new draft GitHub release, which needs to be updated and published.
For more details about GitHub release, follow the [GitHub help](https://help.github.com/en/github/administering-a-repository/managing-releases-in-a-repository#creating-a-release)
Create a [new draft release](https://github.com/maxGraph/maxGraph/releases/)
- name: use the version that has just been published
- tag: use the tag create before
- save it as a draft
This new draft release includes a template to guide the writing of the content, so update the content accordingly to the
changes included in the new version.
Generate the list of the major changes by using the [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes).
It is based on the labels of the merged Pull Requests included in this release and the [GitHub release configuration](https://github.com/maxGraph/maxGraph/blob/development/.github/release.yml).
If the list is incorrect (for example, an item is not in the correct category), update the label(s) or the associated
The list of the major changes has been [automatically generated](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes). Review and adjust it if necessary:
- It is based on the labels of the merged Pull Requests included in this release and the [GitHub release configuration](https://github.com/maxGraph/maxGraph/blob/development/.github/release.yml).
- If the list is incorrect (for example, an item is not in the correct category), update the label(s) or the associated
Pull Request and regenerate the list.
On top of the auto-generated list, add a few words to highlight important changes. In particular, list **_breaking changes_**.
Also add links to the
- npm package
- GitHub milestone
- related paragraph in the Changelog file
Before you publish the release, make sure that a discussion will be created in the `Announces` category when the release
is published.
@ -92,4 +83,3 @@ Review the newly created discussion in the [Announces](https://github.com/maxGra
- adjust the title
- pin the discussion and unpin the previous release announce
- see for example the [maxGraph 0.1.0 release announce](https://github.com/maxGraph/maxGraph/discussions/147).