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

Update release automation setup. #614

Merged
merged 1 commit into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
69 changes: 42 additions & 27 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
# Release Process

The following details how to perform a release for `ember-exam`.
Releases are mostly automated using
[release-it](https://github.com/release-it/release-it/) and
[lerna-changelog](https://github.com/lerna/lerna-changelog/).

## Update Changelog
## Preparation

First, we need to update the changelog using [`git-extras`](https://github.com/tj/git-extras).
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
```
When reviewing merged PR's the labels to be used are:

Be sure to cleanup the changelog by removing merge commits or any commits that don't provide meaningful information. Then, commit the changes with the following message:
* 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.

```bash
git commit -am "Update changelog for vx.x.x"
```
## Release

## Tag A New Version
Once the prep work is completed, the actual release is straight forward:

Next, we need to tag the new version. We do this using the built in `npm` command:
* First, ensure that you have installed your projects dependencies:

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

Then, we push the new commits and tag to the repo:
* 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.

```
git push origin master --tags
```
For instance:

## Publish The New Version
```bash
export GITHUB_AUTH=abc123def456
```

Almost there! We now publish the new version using:
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

```bash
npm publish
```

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

Finally, publish the [release on GitHub](https://github.com/ember-cli/ember-exam/releases) by drafting a new release. Use the changelog to populate the entry.
```sh
npx release-it
```

And that's it! Congratulations!
[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.
50 changes: 35 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
"keywords": [
"ember-addon"
],
"homepage": "https://ember-cli.github.io/ember-exam",
"repository": {
"type": "git",
"url": "https://github.com/ember-cli/ember-exam.git"
},
"license": "MIT",
"author": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": {
"type": "git",
"url": "https://github.com/ember-cli/ember-exam.git"
},
"scripts": {
"build": "ember build --environment=production",
"coverage": "nyc report --reporter=text-lcov | codeclimate-test-reporter",
Expand All @@ -28,6 +29,14 @@
"test:mocha": "TEST_FRAMEWORK=ember-mocha bin/install-test-framework.sh && ember test",
"test:node": "nyc mocha 'node-tests/**/*-test.js'"
},
"nyc": {
"exclude": [
"bower_components",
"config",
"node-tests",
"tests"
]
},
"dependencies": {
"@embroider/macros": "^0.26.0",
"chalk": "^4.1.0",
Expand Down Expand Up @@ -77,6 +86,8 @@
"mocha-eslint": "^6.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"release-it": "^14.0.2",
"release-it-lerna-changelog": "^2.4.0",
"rsvp": "^4.8.5",
"sinon": "^9.1.0",
"testdouble": "^3.16.1"
Expand All @@ -86,26 +97,35 @@
"ember-qunit": "*"
},
"peerDependenciesMeta": {
"ember-qunit": {
"ember-mocha": {
"optional": true
},
"ember-mocha": {
"ember-qunit": {
"optional": true
}
},
"engines": {
"node": "10.* || >= 12"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"ember-addon": {
"configPath": "tests/dummy/config"
},
"nyc": {
"exclude": [
"bower_components",
"config",
"node-tests",
"tests"
]
},
"homepage": "https://ember-cli.github.io/ember-exam"
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
}
}
}
Loading