Skip to content

Commit

Permalink
Merge pull request #51 from phorest/chore/implement-release-it
Browse files Browse the repository at this point in the history
  • Loading branch information
achambers committed Jun 14, 2021
2 parents 1760118 + f119635 commit 57f3da1
Show file tree
Hide file tree
Showing 5 changed files with 1,569 additions and 79 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

/.env
20 changes: 20 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"release-it": {
"git": {
"tagName": "v${version}",
"commitMessage": "🔖 Released v${version}",
"pushArgs": "--follow-tags --no-verify"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"plugins": {
"release-it-lerna-changelog": {
"infile": "CHANGELOG.md"
}
}
}
}
61 changes: 61 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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. This project uses `dotenv-cli` so you can
add the auth token to a `.env` file.

For instance:

```bash
echo "GITHUB_AUTH=abc123def456" > .env
```

[generate-token]: https://github.com/settings/tokens/new?description=release-it-cli&scopes=repo

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

```sh
yarn release
```

[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.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"start": "ember serve",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
"test:ember-compatibility": "ember try:each",
"release": "dotenv release-it --"
},
"dependencies": {
"@ember/render-modifiers": "^1.0.2",
Expand All @@ -44,6 +45,7 @@
"@tailwindcss/ui": "^0.6.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"dotenv-cli": "^4.0.0",
"ember-auto-import": "^1.11.2",
"ember-cli": "~3.26.1",
"ember-cli-dependency-checker": "^3.2.0",
Expand Down Expand Up @@ -79,6 +81,8 @@
"qunit": "^2.14.1",
"qunit-dom": "^1.6.0",
"qunit-wait-for": "^2.0.1",
"release-it": "^14.8.0",
"release-it-lerna-changelog": "^3.1.0",
"tailwindcss": "^1.8.10"
},
"engines": {
Expand Down
Loading

0 comments on commit 57f3da1

Please sign in to comment.