Skip to content

Commit 4124c90

Browse files
authored
chore: automate releases with release-please (#844)
1 parent 3a4f1d7 commit 4124c90

File tree

5 files changed

+77
-2383
lines changed

5 files changed

+77
-2383
lines changed

.github/workflows/release-please.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
issues: write
10+
id-token: write
11+
12+
name: release-please
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
release-type: node
22+
- uses: actions/checkout@v4
23+
if: ${{ steps.release.outputs.release_created }}
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: lts/*
27+
registry-url: https://registry.npmjs.org
28+
if: ${{ steps.release.outputs.release_created }}
29+
- run: |
30+
npm install --force
31+
npm publish --provenance
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
if: ${{ steps.release.outputs.release_created }}

CHANGELOG.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
# check-dependency-version-consistency
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
1+
# Changelog
282

293

304
## v5.0.0 (2024-12-05)

RELEASE.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
# Release Instructions
1+
# 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. `yarn 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/).

package.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"lint:package-json-sorting:fix": "sort-package-json package.json",
4343
"lint:types": "tsc",
4444
"prepublishOnly": "yarn build",
45-
"release": "release-it",
4645
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --colors --coverage"
4746
},
4847
"dependencies": {
@@ -58,7 +57,6 @@
5857
},
5958
"devDependencies": {
6059
"@eslint/js": "^9.29.0",
61-
"@release-it-plugins/lerna-changelog": "^7.0.0",
6260
"@types/edit-json-file": "^1.7.0",
6361
"@types/jest": "^29.5.1",
6462
"@types/mock-fs": "^4.13.1",
@@ -77,7 +75,6 @@
7775
"npm-package-json-lint": "^8.0.0",
7876
"npm-run-all": "^4.1.5",
7977
"prettier": "^3.4.2",
80-
"release-it": "^16.0.0",
8178
"sort-package-json": "^3.0.0",
8279
"ts-jest": "^29.1.0",
8380
"ts-node": "^10.9.2",
@@ -89,20 +86,5 @@
8986
},
9087
"publishConfig": {
9188
"registry": "https://registry.npmjs.org"
92-
},
93-
"release-it": {
94-
"plugins": {
95-
"@release-it-plugins/lerna-changelog": {
96-
"infile": "CHANGELOG.md",
97-
"launchEditor": true
98-
}
99-
},
100-
"git": {
101-
"tagName": "v${version}"
102-
},
103-
"github": {
104-
"release": true,
105-
"tokenRef": "GITHUB_AUTH"
106-
}
10789
}
10890
}

0 commit comments

Comments
 (0)