docs(release): introduction to github releases with nx release (#21814)

This commit is contained in:
Austin Fahsl 2024-02-15 08:06:00 -07:00 committed by GitHub
parent d5e1451634
commit c9c2d978e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 138 additions and 1 deletions

View File

@ -2299,6 +2299,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Automate GitHub Releases",
"path": "/recipes/nx-release/automate-github-releases",
"id": "automate-github-releases",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -4099,6 +4107,14 @@
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Automate GitHub Releases",
"path": "/recipes/nx-release/automate-github-releases",
"id": "automate-github-releases",
"isExternal": false,
"children": [],
"disableCollapsible": false
}
],
"disableCollapsible": false
@ -4135,6 +4151,14 @@
"children": [],
"disableCollapsible": false
},
{
"name": "Automate GitHub Releases",
"path": "/recipes/nx-release/automate-github-releases",
"id": "automate-github-releases",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "Other",
"path": "/recipes/other",

View File

@ -3144,6 +3144,17 @@
"isExternal": false,
"path": "/recipes/nx-release/publish-in-ci-cd",
"tags": ["nx-release"]
},
{
"id": "automate-github-releases",
"name": "Automate GitHub Releases",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/automate-github-releases",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/automate-github-releases",
"tags": ["nx-release"]
}
],
"isExternal": false,
@ -5612,6 +5623,17 @@
"isExternal": false,
"path": "/recipes/nx-release/publish-in-ci-cd",
"tags": ["nx-release"]
},
{
"id": "automate-github-releases",
"name": "Automate GitHub Releases",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/automate-github-releases",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/automate-github-releases",
"tags": ["nx-release"]
}
],
"isExternal": false,
@ -5662,6 +5684,17 @@
"path": "/recipes/nx-release/publish-in-ci-cd",
"tags": ["nx-release"]
},
"/recipes/nx-release/automate-github-releases": {
"id": "automate-github-releases",
"name": "Automate GitHub Releases",
"description": "",
"mediaImage": "",
"file": "shared/recipes/nx-release/automate-github-releases",
"itemList": [],
"isExternal": false,
"path": "/recipes/nx-release/automate-github-releases",
"tags": ["nx-release"]
},
"/recipes/other": {
"id": "other",
"name": "Other",

View File

@ -1008,6 +1008,13 @@
"id": "publish-in-ci-cd",
"name": "Publish in CI/CD",
"path": "/recipes/nx-release/publish-in-ci-cd"
},
{
"description": "",
"file": "shared/recipes/nx-release/automate-github-releases",
"id": "automate-github-releases",
"name": "Automate GitHub Releases",
"path": "/recipes/nx-release/automate-github-releases"
}
],
"database": [

View File

@ -1129,6 +1129,12 @@
"id": "publish-in-ci-cd",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/publish-in-ci-cd"
},
{
"name": "Automate GitHub Releases",
"id": "automate-github-releases",
"tags": ["nx-release"],
"file": "shared/recipes/nx-release/automate-github-releases"
}
]
},

View File

@ -0,0 +1,66 @@
# Automate GitHub Releases
Nx Release can automate the creation of [GitHub releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) for you. GitHub releases are a great way to communicate the changes in your projects to your users.
## GitHub Release Contents
When a GitHub release is created, it will include the changelog that Nx Release generates with entries based on the changes since the last release. Nx Release will parse the `feat` and `fix` type commits according to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification and sort them into appropriate sections of the changelog. Take a look at the [Nx releases page](https://github.com/nrwl/nx/releases) to see examples of GitHub releases generated by Nx Release.
## Enable Release Creation
To enable GitHub release creation for your workspace, set `release.changelog.workspaceChangelog.createRelease` to `'github'` in `nx.json`:
```json
{
"release": {
"changelog": {
"workspaceChangelog": {
"createRelease": "github"
}
}
}
}
```
## Preview the Release
Use `nx release --dry-run` to preview the GitHub release instead of creating it. This allows you to see what the release will look like without pushing anything to GitHub.
## Disable File Creation
Since GitHub releases contain the changelog, you may wish to disable the generation and management of local the `CHANGELOG.md` file. To do this, set `release.changelog.workspaceChangelog.file` to `false` in `nx.json`:
```json
{
"release": {
"changelog": {
"workspaceChangelog": {
"file": false,
"createRelease": "github"
}
}
}
}
```
Note: When configured this way, Nx Release will not delete existing changelog files, just ignore them.
## Project Level Changelogs
Nx Release supports creating GitHub releases for project level changelogs as well. This is particularly useful when [releasing projects independently](/recipes/nx-release/release-projects-independently). To enable this, set `release.changelog.projectChangelogs.createRelease` to `'github'` in `nx.json`:
```json
{
"release": {
"changelog": {
"projectChangelogs": {
"createRelease": "github"
}
}
}
}
```
{% callout type="warning" title="Project and Workspace GitHub Releases" %}
Nx Release does not support creating GitHub releases for both project level changelogs and the workspace changelog. You will need to choose one or the other.
{% /callout %}

View File

@ -274,4 +274,4 @@ For this same example, if you want the commit message to be 'chore(release): 1.2
After the first release, the `--first-release` option will no longer be required. Nx Release will expect to find git tags and changelog files for each package. It will also use `npm view` to look up the current version of packages before publishing, ensuring that the package has not already been published and therefore avoid any conflict errors, meaning you can run the same publish action multiple times without any negative side-effects.
Future releases will also generate entries in `CHANGELOG.md` based on the changes since the last release. Nx Release will parse the commits according to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification and sort them into the appropriate sections of the changelog. An example of these changelogs can be seen on the [Nx releases page](https://github.com/nrwl/nx/releases).
Future releases will also generate entries in `CHANGELOG.md` based on the changes since the last release. Nx Release will parse the `feat` and `fix` type commits according to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification and sort them into appropriate sections of the changelog. An example of these changelogs can be seen on the [Nx releases page](https://github.com/nrwl/nx/releases).

View File

@ -180,6 +180,7 @@
- [Release Projects Independently](/recipes/nx-release/release-projects-independently)
- [Automatically Version with Conventional Commits](/recipes/nx-release/automatically-version-with-conventional-commits)
- [Publish in CI/CD](/recipes/nx-release/publish-in-ci-cd)
- [Automate GitHub Releases](/recipes/nx-release/automate-github-releases)
- [Other](/recipes/other)
- [Rescope Packages from @nrwl to @nx](/recipes/other/rescope)
- [Showcase](/showcase)