Skip to content

Commit fc6b7de

Browse files
authored
Merge pull request #289 from ember-cli/release-plan
setup release-plan
2 parents 830f0d0 + 9cb6035 commit fc6b7de

5 files changed

Lines changed: 1539 additions & 66 deletions

File tree

.github/workflows/plan-release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Plan Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
9+
types:
10+
- labeled
11+
- unlabeled
12+
13+
concurrency:
14+
group: plan-release # only the latest one of these should ever be running
15+
cancel-in-progress: true
16+
17+
jobs:
18+
should-run-release-plan-prepare:
19+
name: Should we run release-plan prepare?
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
23+
steps:
24+
- uses: release-plan/actions/should-prepare-release@v1
25+
with:
26+
ref: 'master'
27+
id: should-prepare
28+
29+
create-prepare-release-pr:
30+
name: Create Prepare Release PR
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 5
33+
needs: should-run-release-plan-prepare
34+
permissions:
35+
contents: write
36+
issues: read
37+
pull-requests: write
38+
if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
39+
steps:
40+
- uses: release-plan/actions/prepare@v1
41+
name: Run release-plan prepare
42+
with:
43+
ref: 'master'
44+
env:
45+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
46+
id: explanation
47+
48+
- uses: peter-evans/create-pull-request@v8
49+
name: Create Prepare Release PR
50+
with:
51+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
52+
labels: "internal"
53+
sign-commits: true
54+
branch: release-preview
55+
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
56+
body: |
57+
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
58+
59+
-----------------------------------------
60+
61+
${{ steps.explanation.outputs.text }}

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# For every push to the primary branch with .release-plan.json modified,
2+
# runs release-plan.
3+
4+
name: Publish Stable
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
- master
12+
paths:
13+
- '.release-plan.json'
14+
15+
concurrency:
16+
group: publish-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
publish:
21+
name: "NPM Publish"
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
attestations: write
27+
28+
steps:
29+
- uses: actions/checkout@v6
30+
- uses: pnpm/action-setup@v5
31+
- uses: actions/setup-node@v6
32+
with:
33+
node-version: 24
34+
registry-url: 'https://registry.npmjs.org'
35+
cache: pnpm
36+
- run: pnpm install --frozen-lockfile
37+
- name: Publish to NPM
38+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
39+
env:
40+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

RELEASE.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# Release Process
22

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/).
3+
Releases in this repo are mostly automated using [release-plan](https://github.com/embroider-build/release-plan/). Once you label all your PRs correctly (see below) you will have an automatically generated PR that updates your CHANGELOG.md file and a `.release-plan.json` that is used to prepare the release once the PR is merged.
64

75
## Preparation
86

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
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
8+
9+
- correctly labeling **all** pull requests that have been merged since the last release
10+
- updating pull request titles so they make sense to our users
11+
12+
Some great information on why this is important can be found at [keepachangelog.com](https://keepachangelog.com/en/1.1.0/), but the overall
1613
guiding principle here is that changelogs are for humans, not machines.
1714

1815
When reviewing merged PR's the labels to be used are:
@@ -21,40 +18,10 @@ When reviewing merged PR's the labels to be used are:
2118
- enhancement - Used when the PR adds a new feature or enhancement.
2219
- bug - Used when the PR fixes a bug included in a previous release.
2320
- 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:
21+
- internal - Internal changes or things that don't fit in any other category.
3222

33-
```sh
34-
yarn install
35-
```
23+
**Note:** `release-plan` requires that **all** PRs are labeled. If a PR doesn't fit in a category it's fine to label it as `internal`
3624

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-
npx release-it
54-
```
25+
## Release
5526

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.
27+
Once the prep work is completed, the actual release is straight forward: you just need to merge the open [Plan Release](https://github.com/ember-cli/ember-cli-version-checker/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
],
2323
"scripts": {
2424
"changelog": "lerna-changelog",
25-
"test": "mocha tests/*-tests.js",
2625
"format": "prettier . --cache --write",
2726
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
2827
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\" --prefixColors auto && npm run format",
2928
"lint:format": "prettier . --cache --check",
3029
"lint:js": "eslint . --cache",
3130
"lint:js:fix": "eslint . --fix",
31+
"test": "mocha tests/*-tests.js",
3232
"test:debug": "mocha debug tests/*-tests.js"
3333
},
3434
"prettier": {
@@ -49,31 +49,17 @@
4949
"fixturify-project": "^2.1.1",
5050
"globals": "^17.7.0",
5151
"mocha": "^11.7.6",
52-
"prettier": "^3.9.5"
52+
"prettier": "^3.9.5",
53+
"release-plan": "^0.18.0"
5354
},
55+
"packageManager": "[email protected]+sha512.81350b07e53c9538a02f1f2303b4290fa2d7be04e56e2a970c4cc4b417dc761de196edabd49d55c7dc9580db81007c44143e4e3d7e462b3000d23c255122d065",
5456
"engines": {
5557
"node": "22.* || 24.* || >= 26.*"
5658
},
57-
"publishConfig": {
58-
"registry": "https://registry.npmjs.org"
59-
},
60-
"release-it": {
61-
"plugins": {
62-
"release-it-lerna-changelog": {
63-
"infile": "CHANGELOG.md",
64-
"launchEditor": true
65-
}
66-
},
67-
"git": {
68-
"tagName": "v${version}"
69-
},
70-
"github": {
71-
"release": true,
72-
"tokenRef": "GITHUB_AUTH"
73-
}
74-
},
7559
"volta": {
7660
"node": "10.19.0"
7761
},
78-
"packageManager": "[email protected]+sha512.81350b07e53c9538a02f1f2303b4290fa2d7be04e56e2a970c4cc4b417dc761de196edabd49d55c7dc9580db81007c44143e4e3d7e462b3000d23c255122d065"
62+
"publishConfig": {
63+
"registry": "https://registry.npmjs.org"
64+
}
7965
}

0 commit comments

Comments
 (0)