Skip to content

Commit e64a10c

Browse files
Merge pull request #526 from emberjs/release-plan
start using release-plan
2 parents ce601d2 + 44038d2 commit e64a10c

File tree

7 files changed

+492
-1542
lines changed

7 files changed

+492
-1542
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,28 +91,3 @@ jobs:
9191
run: pnpm install --no-lockfile
9292
- name: test
9393
run: pnpm test
94-
95-
publish:
96-
name: Publish to npm
97-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
98-
runs-on: ubuntu-latest
99-
steps:
100-
- name: Checkout
101-
uses: actions/checkout@v6
102-
103-
- name: Install node
104-
uses: actions/setup-node@v6
105-
with:
106-
node-version: 16
107-
registry-url: 'https://registry.npmjs.org'
108-
109-
- name: install dependencies
110-
run: pnpm install
111-
112-
- name: auto-dist-tag
113-
run: pnpm auto-dist-tag --write
114-
115-
- name: publish to npm
116-
run: npm publish
117-
env:
118-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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@v4
31+
- uses: actions/setup-node@v6
32+
with:
33+
node-version: 22
34+
registry-url: 'https://registry.npmjs.org'
35+
cache: pnpm
36+
- run: npm install -g npm@latest # ensure that the globally installed npm is new enough to support OIDC
37+
- run: pnpm install --frozen-lockfile
38+
- name: Publish to NPM
39+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
40+
env:
41+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Changelog
2+
13

24

35

RELEASE.md

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,27 @@
1-
# Release
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/).
1+
# Release Process
62

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.
74

85
## Preparation
96

10-
Since the majority of the actual release process is automated, the primary
11-
remaining task prior to releasing is confirming that all pull requests that
12-
have been merged since the last release have been labeled with the appropriate
13-
`lerna-changelog` labels and the titles have been updated to ensure they
14-
represent something that would make sense to our users. Some great information
15-
on why this is important can be found at
16-
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
17-
guiding principles here is that changelogs are for humans, not machines.
18-
19-
When reviewing merged PR's the labels to be used are:
20-
21-
* breaking - Used when the PR is considered a breaking change.
22-
* enhancement - Used when the PR adds a new feature or enhancement.
23-
* bug - Used when the PR fixes a bug included in a previous release.
24-
* documentation - Used when the PR adds or updates documentation.
25-
* internal - Used for internal changes that still require a mention in the
26-
changelog/release notes.
27-
28-
29-
## Release
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
308

31-
Once the prep work is completed, the actual release is straight forward:
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
3211

33-
* First ensure that you have `release-it` installed globally, generally done by
34-
using one of the following commands:
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
13+
guiding principle here is that changelogs are for humans, not machines.
3514

36-
```
37-
# using https://volta.sh
38-
volta install release-it
39-
40-
# using Yarn
41-
yarn global add release-it
42-
43-
# using npm
44-
npm install --global release-it
45-
```
46-
47-
* Second, ensure that you have installed your projects dependencies:
48-
49-
```
50-
# using yarn
51-
yarn install
15+
When reviewing merged PR's the labels to be used are:
5216

53-
# using npm
54-
npm install
55-
```
17+
- breaking - Used when the PR is considered a breaking change.
18+
- enhancement - Used when the PR adds a new feature or enhancement.
19+
- bug - Used when the PR fixes a bug included in a previous release.
20+
- documentation - Used when the PR adds or updates documentation.
21+
- internal - Internal changes or things that don't fit in any other category.
5622

57-
* And last (but not least 😁) do your release:
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`
5824

59-
```
60-
release-it
61-
```
25+
## Release
6226

63-
[release-it](https://github.com/release-it/release-it/) manages the actual
64-
release process. It will prompt you through the process of choosing the version
65-
number, tagging, 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/babel/ember-cli-babel/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
},
2121
"license": "MIT",
2222
"author": "Gordon Kristan",
23-
"files": [
24-
"index.js",
25-
"lib"
26-
],
2723
"directories": {
2824
"doc": "doc",
2925
"test": "tests"
3026
},
27+
"files": [
28+
"index.js",
29+
"lib"
30+
],
3131
"scripts": {
3232
"build": "ember build",
3333
"lint:js": "eslint . --cache",
@@ -39,9 +39,6 @@
3939
"test:node": "mocha node-tests",
4040
"test:node:debug": "mocha debug node-tests"
4141
},
42-
"peerDependencies": {
43-
"@babel/core": "^7.12.0"
44-
},
4542
"dependencies": {
4643
"@babel/helper-compilation-targets": "^7.20.7",
4744
"@babel/plugin-proposal-decorators": "^7.20.13",
@@ -78,7 +75,6 @@
7875
"@ember/test-helpers": "^3.2.0",
7976
"@glimmer/component": "^1.0.4",
8077
"@glimmer/tracking": "^1.0.4",
81-
"@release-it-plugins/lerna-changelog": "^6.0.0",
8278
"babel-eslint": "^10.1.0",
8379
"broccoli-test-helper": "^2.0.0",
8480
"chai": "^4.3.7",
@@ -106,48 +102,25 @@
106102
"mocha": "^10.2.0",
107103
"qunit": "^2.19.4",
108104
"regenerator-runtime": "^0.14.0",
109-
"release-it": "^16.1.5",
105+
"release-plan": "^0.17.4",
110106
"resolve": "^1.22.4",
111107
"rimraf": "^5.0.1",
112108
"webpack": "^5.88.2"
113109
},
110+
"peerDependencies": {
111+
"@babel/core": "^7.12.0"
112+
},
113+
"packageManager": "pnpm@8.15.9",
114114
"engines": {
115115
"node": "16.* || 18.* || >= 20"
116116
},
117117
"publishConfig": {
118118
"registry": "https://registry.npmjs.org"
119119
},
120-
"changelog": {
121-
"repo": "babel/ember-cli-babel",
122-
"labels": {
123-
"breaking": ":boom: Breaking Change",
124-
"enhancement": ":rocket: Enhancement",
125-
"bug": ":bug: Bug Fix",
126-
"documentation": ":memo: Documentation",
127-
"internal": ":house: Internal"
128-
}
129-
},
130120
"ember": {
131121
"edition": "octane"
132122
},
133123
"ember-addon": {
134124
"configPath": "tests/dummy/config"
135-
},
136-
"release-it": {
137-
"plugins": {
138-
"@release-it-plugins/lerna-changelog": {
139-
"infile": "CHANGELOG.md"
140-
}
141-
},
142-
"git": {
143-
"tagName": "v${version}"
144-
},
145-
"github": {
146-
"release": true
147-
},
148-
"npm": {
149-
"publish": false
150-
}
151-
},
152-
"packageManager": "pnpm@8.15.9"
125+
}
153126
}

0 commit comments

Comments
 (0)