Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup automated release system. #183

Merged
merged 2 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 43 additions & 28 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,62 @@
# Release Process
# Release

The following is the release process you should follow to publish a new version of `ember-a11y-testing`.
Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).

## Update The Changelog

First, we need to update the `CHANGELOG.md` file for the project. This requires having [`git-extras`](https://github.com/tj/git-extras) installed.
## Preparation

Checkout the current `master` version of the repo and run:
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.

```bash
git changelog
```

Clean up the generated changelog by inserting the appropriate verion number and removing merge commits and previous release commits if necessary.
When reviewing merged PR's the labels to be used are:

Review the changes and then commit them with a message like:
* 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.
drewlee marked this conversation as resolved.
Show resolved Hide resolved

```bash
git commit -am "Update CHANGELOG for x.x.x"
```

Where `x.x.x` is the version you are releasing.
## Release

## Bump The Version
Once the prep work is completed, the actual release is straight forward:
MelSumner marked this conversation as resolved.
Show resolved Hide resolved

Next, we bump the version of the addon and tag it. You can do this by using the default `npm version` command, like so:
* First, ensure that you have installed your projects dependencies:

```bash
npm version x.x.x
```
yarn install
```

That should bump the version in `package.json`, commit it, and then tag it.
* 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.

Next, push the version bump and the changelog changes to the repository (ensure you push the new tag as well).
For instance:

## Publish The Release
```bash
export GITHUB_AUTH=abc123def456
```

Once the changes have been pushed, run:
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

```bash
npm publish
```
* And last (but not least 😁) do your release.

To actually publish the new release.
```
npx release-it
```

Finally, update the [GitHub Releases page](https://github.com/ember-a11y/ember-a11y-testing/releases) with a new release; using the changelog info as the release notes.
[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.
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,33 @@
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"qunit-dom": "^1.4.0",
"release-it": "^13.6.5",
"release-it-lerna-changelog": "^2.3.0",
"sass": "^1.26.10"
},
"engines": {
"node": "10.* || >= 12"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"ember-addon": {
"demoURL": "http://ember-a11y.github.io/ember-a11y-testing",
"configPath": "tests/dummy/config"
},
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
}
}
}
Loading