Skip to content

Commit

Permalink
Setup release-it
Browse files Browse the repository at this point in the history
Using `yarn create rwjblue-release-it-setup`
  • Loading branch information
simonihmig committed Oct 22, 2020
1 parent 5ad6191 commit 58beb7e
Show file tree
Hide file tree
Showing 4 changed files with 1,786 additions and 75 deletions.
Empty file added CHANGELOG.md
Empty file.
60 changes: 60 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Release Process

Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).

## Preparation

Since the majority of the actual release process is automated, the primary
remaining task prior to releasing is confirming that all pull requests that
have been merged since the last release have been labeled with the appropriate
`lerna-changelog` labels and the titles have been updated to ensure they
represent something that would make sense to our users. Some great information
on why this is important can be found at
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
guiding principle here is that changelogs are for humans, not machines.

When reviewing merged PR's the labels to be used are:

* breaking - Used when the PR is considered a breaking change.
* enhancement - Used when the PR adds a new feature or enhancement.
* bug - Used when the PR fixes a bug included in a previous release.
* documentation - Used when the PR adds or updates documentation.
* internal - Used for internal changes that still require a mention in the
changelog/release notes.

## Release

Once the prep work is completed, the actual release is straight forward:

* First, ensure that you have installed your projects dependencies:

```sh
yarn install
```

* Second, ensure that you have obtained a
[GitHub personal access token][generate-token] with the `repo` scope (no
other permissions are needed). Make sure the token is available as the
`GITHUB_AUTH` environment variable.

For instance:

```bash
export GITHUB_AUTH=abc123def456
```

[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

* And last (but not least 😁) do your release.

```sh
npx release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.
31 changes: 24 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"name": "broccoli-concat-analyser",
"bin": {
"broccoli-concat-analyser": "lib/cli.js"
},
"version": "4.3.5",
"description": "",
"main": "lib/index.js",
Expand All @@ -13,12 +10,15 @@
"type": "git",
"url": "git+https://github.com/stefanpenner/broccoli-concat-analyser.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/stefanpenner/broccoli-concat-analyser/issues"
"author": "",
"main": "lib/index.js",
"bin": {
"broccoli-concat-analyser": "lib/cli.js"
},
"scripts": {
"test": "mocha --recursive test/**/*-test.js"
},
"homepage": "https://github.com/stefanpenner/broccoli-concat-analyser#readme",
"dependencies": {
"filesize": "^6.1.0",
"fs-extra": "^9.0.1",
Expand All @@ -34,12 +34,29 @@
"eslint-plugin-jest": "^24.0.2",
"html-validator": "^5.1.17",
"jest": "^26.4.2",
"release-it": "^14.0.2",
"release-it-lerna-changelog": "^2.4.0",
"tmp": "^0.2.1"
},
"engines": {
"node": ">= 10.*"
},
"volta": {
"node": "10.22.1"
},
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
}
}
}
Loading

0 comments on commit 58beb7e

Please sign in to comment.