Skip to content

Commit 11457bc

Browse files
authored
chore: automate releases with release-please (#736)
1 parent 00c4fa1 commit 11457bc

File tree

5 files changed

+242
-4162
lines changed

5 files changed

+242
-4162
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
id: release
18+
with:
19+
release-type: node
20+
package-name: 'eslint-doc-generator'
21+
pull-request-title-pattern: 'chore: release${component} ${version}'
22+
changelog-types: >
23+
[
24+
{ "type": "feat", "section": "Features", "hidden": false },
25+
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
26+
{ "type": "docs", "section": "Documentation", "hidden": false },
27+
{ "type": "build", "section": "Chores", "hidden": false },
28+
{ "type": "chore", "section": "Chores", "hidden": false },
29+
{ "type": "perf", "section": "Chores", "hidden": false },
30+
{ "type": "ci", "section": "Chores", "hidden": false },
31+
{ "type": "refactor", "section": "Chores", "hidden": false },
32+
{ "type": "test", "section": "Chores", "hidden": false }
33+
]
34+
- uses: actions/checkout@v4
35+
if: ${{ steps.release.outputs.release_created }}
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: lts/*
39+
registry-url: https://registry.npmjs.org
40+
if: ${{ steps.release.outputs.release_created }}
41+
- run: |
42+
npm install --force
43+
npm publish --provenance
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
if: ${{ steps.release.outputs.release_created }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Alternatively, you can configure your scripts to run `prettier` after this tool:
393393

394394
This tool follows [semantic versioning](https://semver.org/).
395395

396-
New features will be released as a minor version, while bug fixes will be released as a patch version.
396+
New features will be [released](./RELEASE.md) as a minor version, while bug fixes will be released as a patch version.
397397

398398
Breaking changes will be released as a major version and include:
399399

RELEASE.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
# Releases
22

3-
1. Check that notable PRs since the last release are labeled and have clear and consistent titles
4-
5-
2. `git pull` the latest `main` and ensure that `git status` shows no local changes
6-
7-
3. `export GITHUB_AUTH="..."` with a [GitHub access token](https://github.com/settings/tokens/new?scopes=repo&description=release-it) with "repo" access so [release-it](https://github.com/release-it/release-it) can conduct a GitHub release and [lerna-changelog](https://github.com/lerna/lerna-changelog) can download the change history
8-
9-
4. `export EDITOR="vim"` to choose an editor for editing the changelog
10-
11-
5. `npm run release` (uses [@release-it-plugins/lerna-changelog](https://github.com/release-it-plugins/lerna-changelog) to handle versioning, the changelog, publishing to GitHub and NPM, etc)
3+
[release-please](https://github.com/googleapis/release-please) will automatically open up PRs to conduct releases based on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).

0 commit comments

Comments
 (0)