Skip to content

Commit 808ae19

Browse files
committed
automate part of the release process
1 parent 70f4a6f commit 808ae19

File tree

5 files changed

+2279
-39
lines changed

5 files changed

+2279
-39
lines changed

.release-it.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { Config } from "release-it";
2+
3+
export default {
4+
hooks: {
5+
"before:init": ["git pull", "npm run lint"],
6+
},
7+
// https://github.com/release-it/release-it/blob/main/docs/git.md
8+
git: {
9+
commit: true,
10+
commitMessage: "Release v${version}",
11+
tag: true,
12+
tagName: "v${version}",
13+
push: true,
14+
},
15+
// https://github.com/release-it/release-it/blob/main/docs/github-releases.md
16+
github: {
17+
release: true,
18+
releaseName: "Release v${version}",
19+
},
20+
plugins: {
21+
"@release-it/keep-a-changelog": {
22+
// changes the version in the changelog file.
23+
// Also, the addition of this plugin allows extraction of the version
24+
// changes from the changelog files and their use in GitHub release notes
25+
filename: "CHANGELOG.md",
26+
addUnreleased: true,
27+
},
28+
},
29+
npm: {
30+
publish: false,
31+
},
32+
} satisfies Config;

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

6-
## [UNRELEASED]
6+
## [Unreleased]
77

88
### Added
99

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,18 @@ npm run build
160160

161161
## Release Process
162162

163-
- Add the version and date to the changelog `## [<version>] - <yyyy-mm-dd>` and keep `## [UNRELEASED]` at the top.
164-
- Set the version in `package.json`
165-
- Commit the changes and push a git tag `v<version>`.
166-
- Create a GitHub release with the same version and changes copied from the changelog.
163+
- [optional] Set env variable
164+
`GITHUB_TOKEN` ([generate token](https://github.com/settings/tokens/new?scopes=repo&description=indexeddb-browser-github-release))
165+
- Run `npm run release`
166+
- Pull the latest changes on main.
167+
- Check for linting issues `npm run lint`.
168+
- Set the version in `package.json`
169+
- Add the version and date to the changelog `## [<version>] - <yyyy-mm-dd>` and keep `## [UNRELEASED]` at the top.
170+
- Commit the changes and create a git tag `v<version>`.
171+
- Push the local commit and tag to GitHub.
172+
- Open the GitHub release page with the fields prepopulated. The release notes are copied from the changelog.
173+
- Create the GitHub release, done automatically if the GITHUB_TOKEN env variable is set. Otherwise, a new release page
174+
is opened in the browser with fields prepopulated.
167175
- Package the extension with `npm run build`.
168176
- Upload the packaged extension to the Chrome web store.
169177

0 commit comments

Comments
 (0)