Skip to content

Commit 30d04e8

Browse files
committed
Setup release process
1 parent e58e725 commit 30d04e8

File tree

5 files changed

+1944
-38
lines changed

5 files changed

+1944
-38
lines changed

.github/workflows/release.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,27 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
14+
- uses: actions/checkout@v3
15+
- name: Install pnpm
16+
uses: pnpm/action-setup@v2
1617
with:
17-
node-version: 14
18-
registry-url: 'https://registry.npmjs.org'
18+
version: 7
19+
- name: Install Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 14.x
23+
cache: pnpm
24+
25+
- name: Install Dependencies
26+
run: pnpm install --frozen-lockfile
1927

20-
- run: yarn install
21-
- run: yarn build
28+
- name: Build package
29+
- run: pnpm build
2230

2331
- name: auto-dist-tag
24-
run: npx auto-dist-tag@1 --write
32+
run: pnpx auto-dist-tag@1 --write ./ember-click-outside/package.json
2533

26-
- run: npm publish
34+
- name: pnpm publish
35+
run: pnpm --filter ember-click-outside publish
2736
env:
2837
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-it.js

-20
This file was deleted.

RELEASE.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Release Process
2+
3+
Releases are mostly automated using
4+
[release-it](https://github.com/release-it/release-it/) and
5+
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
6+
7+
## Preparation
8+
9+
Since the majority of the actual release process is automated, the primary
10+
remaining task prior to releasing is confirming that all pull requests that
11+
have been merged since the last release have been labeled with the appropriate
12+
`lerna-changelog` labels and the titles have been updated to ensure they
13+
represent something that would make sense to our users. Some great information
14+
on why this is important can be found at
15+
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16+
guiding principle here is that changelogs are for humans, not machines.
17+
18+
When reviewing merged PR's the labels to be used are:
19+
20+
* breaking - Used when the PR is considered a breaking change.
21+
* enhancement - Used when the PR adds a new feature or enhancement.
22+
* bug - Used when the PR fixes a bug included in a previous release.
23+
* documentation - Used when the PR adds or updates documentation.
24+
* internal - Used for internal changes that still require a mention in the
25+
changelog/release notes.
26+
27+
## Release
28+
29+
Once the prep work is completed, the actual release is straight forward:
30+
31+
* First, ensure that you have installed your projects dependencies:
32+
33+
```sh
34+
pnpm install
35+
```
36+
37+
* Second, ensure that you have obtained a
38+
[GitHub personal access token][generate-token] with the `repo` scope (no
39+
other permissions are needed). Make sure the token is available as the
40+
`GITHUB_AUTH` environment variable.
41+
42+
For instance:
43+
44+
```bash
45+
export GITHUB_AUTH=abc123def456
46+
```
47+
48+
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
49+
50+
* And last (but not least 😁) do your release.
51+
52+
```sh
53+
pnpm exec release-it
54+
```
55+
56+
[release-it](https://github.com/release-it/release-it/) manages the actual
57+
release process. It will prompt you to to choose the version number after which
58+
you will have the chance to hand tweak the changelog to be used (for the
59+
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60+
pushing the tag and commits, etc.

package.json

+33-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,45 @@
55
"repository": "https://github.com/zeppelin/ember-click-outside",
66
"license": "MIT",
77
"author": "Gabor Babicz <[email protected]>",
8+
"workspaces": [
9+
"ember-click-outside",
10+
"test-app"
11+
],
812
"scripts": {
9-
"prepare": "pnpm build",
1013
"build": "pnpm --filter ember-click-outside build",
14+
"lint": "pnpm --filter '*' lint",
15+
"lint:fix": "pnpm --filter '*' lint:fix",
16+
"prepare": "pnpm build",
1117
"start": "concurrently 'npm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
12-
"start:tests": "pnpm --filter test-app start",
1318
"start:addon": "pnpm --filter ember-click-outside start --no-watch.clearScreen",
14-
"test": "pnpm --filter test-app test",
15-
"lint": "pnpm --filter '*' lint",
16-
"lint:fix": "pnpm --filter '*' lint:fix"
19+
"start:tests": "pnpm --filter test-app start",
20+
"test": "pnpm --filter test-app test"
1721
},
1822
"devDependencies": {
23+
"@release-it-plugins/lerna-changelog": "^5.0.0",
24+
"@release-it-plugins/workspaces": "^3.2.0",
1925
"concurrently": "^7.2.1",
20-
"prettier": "^2.5.1"
26+
"prettier": "^2.5.1",
27+
"release-it": "^15.5.0"
2128
},
22-
"workspaces": [
23-
"ember-click-outside",
24-
"test-app"
25-
]
29+
"publishConfig": {
30+
"registry": "https://registry.npmjs.org"
31+
},
32+
"release-it": {
33+
"plugins": {
34+
"@release-it-plugins/lerna-changelog": {
35+
"infile": "CHANGELOG.md",
36+
"launchEditor": false
37+
},
38+
"@release-it-plugins/workspaces": true
39+
},
40+
"git": {
41+
"tagName": "v${version}"
42+
},
43+
"github": {
44+
"release": true,
45+
"tokenRef": "GITHUB_AUTH"
46+
},
47+
"npm": false
48+
}
2649
}

0 commit comments

Comments
 (0)