Skip to content

Commit b117468

Browse files
Merge pull request #3107 from mainmatter/update-release-plan
chore(release): npx create-release-plan-setup@latest
2 parents 6afa336 + 6509321 commit b117468

5 files changed

Lines changed: 75 additions & 137 deletions

File tree

.github/workflows/plan-release.yml

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: Release Plan Review
1+
name: Plan Release
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main
@@ -9,79 +10,49 @@ on:
910
- labeled
1011
- unlabeled
1112

12-
env:
13-
VOLTA_FEATURE_PNPM: 1
14-
1513
concurrency:
1614
group: plan-release # only the latest one of these should ever be running
1715
cancel-in-progress: true
1816

1917
jobs:
20-
check-plan:
21-
name: "Check Release Plan"
18+
should-run-release-plan-prepare:
19+
name: Should we run release-plan prepare?
2220
runs-on: ubuntu-latest
2321
outputs:
24-
command: ${{ steps.check-release.outputs.command }}
25-
22+
should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
2623
steps:
27-
- uses: actions/checkout@v6
24+
- uses: release-plan/actions/should-prepare-release@v1
2825
with:
29-
fetch-depth: 0
3026
ref: 'master'
31-
# This will only cause the `check-plan` job to have a "command" of `release`
32-
# when the .release-plan.json file was changed on the last commit.
33-
- id: check-release
34-
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
27+
id: should-prepare
3528

36-
prepare_release_notes:
37-
name: Prepare Release Notes
29+
create-prepare-release-pr:
30+
name: Create Prepare Release PR
3831
runs-on: ubuntu-latest
3932
timeout-minutes: 5
40-
needs: check-plan
33+
needs: should-run-release-plan-prepare
4134
permissions:
4235
contents: write
4336
issues: read
4437
pull-requests: write
45-
outputs:
46-
explanation: ${{ steps.explanation.outputs.text }}
47-
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
48-
# only run on labeled event if the PR has already been merged
49-
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
50-
38+
if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
5139
steps:
52-
- uses: actions/checkout@v6
53-
# We need to download lots of history so that
54-
# github-changelog can discover what's changed since the last release
40+
- uses: release-plan/actions/prepare@v1
41+
name: Run release-plan prepare
5542
with:
56-
fetch-depth: 0
5743
ref: 'master'
58-
- uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4
59-
- run: pnpm install --frozen-lockfile
60-
- name: "Generate Explanation and Prep Changelogs"
61-
id: explanation
62-
run: |
63-
set +e
64-
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
65-
66-
if [ $? -ne 0 ]; then
67-
echo 'text<<EOF' >> $GITHUB_OUTPUT
68-
cat release-plan-stderr.txt >> $GITHUB_OUTPUT
69-
echo 'EOF' >> $GITHUB_OUTPUT
70-
else
71-
echo 'text<<EOF' >> $GITHUB_OUTPUT
72-
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
73-
echo 'EOF' >> $GITHUB_OUTPUT
74-
rm release-plan-stderr.txt
75-
fi
7644
env:
7745
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
46+
id: explanation
7847

7948
- uses: peter-evans/create-pull-request@v8
49+
name: Create Prepare Release PR
8050
with:
81-
commit-message: "Prepare Release using 'release-plan'"
51+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
8252
labels: "internal"
53+
sign-commits: true
8354
branch: release-preview
84-
title: Prepare Release
55+
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
8556
body: |
8657
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 👍
8758

.github/workflows/publish.yml

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,40 @@
1-
# For every push to the master branch, this checks if the release-plan was
2-
# updated and if it was it will publish stable npm packages based on the
3-
# release plan
1+
# For every push to the primary branch with .release-plan.json modified,
2+
# runs release-plan.
43

54
name: Publish Stable
65

7-
env:
8-
VOLTA_FEATURE_PNPM: 1
9-
106
on:
117
workflow_dispatch:
128
push:
139
branches:
10+
- main
1411
- master
12+
paths:
13+
- '.release-plan.json'
1514

1615
concurrency:
1716
group: publish-${{ github.head_ref || github.ref }}
1817
cancel-in-progress: true
1918

2019
jobs:
21-
check-plan:
22-
name: "Check Release Plan"
23-
runs-on: ubuntu-latest
24-
outputs:
25-
command: ${{ steps.check-release.outputs.command }}
26-
27-
steps:
28-
- uses: actions/checkout@v6
29-
with:
30-
fetch-depth: 0
31-
ref: 'master'
32-
# This will only cause the `check-plan` job to have a result of `success`
33-
# when the .release-plan.json file was changed on the last commit. This
34-
# plus the fact that this action only runs on main will be enough of a guard
35-
- id: check-release
36-
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
37-
3820
publish:
3921
name: "NPM Publish"
4022
runs-on: ubuntu-latest
41-
needs: check-plan
42-
if: needs.check-plan.outputs.command == 'release'
4323
permissions:
4424
contents: write
45-
pull-requests: write
25+
id-token: write
26+
attestations: write
4627

4728
steps:
4829
- uses: actions/checkout@v6
49-
- uses: volta-cli/action@5c175f92dea6f48441c436471e6479dbc192e194 # v4
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
5036
- run: pnpm install --frozen-lockfile
51-
- name: Set publishing config
52-
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
53-
env:
54-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55-
- name: npm publish
56-
run: pnpm release-plan publish
37+
- name: Publish to NPM
38+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
5739
env:
5840
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
59-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

RELEASE.md

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,27 @@
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
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
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
288

29-
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
3011

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:
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.
4314

44-
```bash
45-
export GITHUB_AUTH=abc123def456
46-
```
15+
When reviewing merged PR's the labels to be used are:
4716

48-
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
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.
4922

50-
* 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`
5124

52-
```sh
53-
pnpm release
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/mainmatter/ember-simple-auth/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"globals": "17.0.0",
2828
"lerna-changelog": "2.2.0",
2929
"release-it": "19.0.6",
30-
"release-plan": "0.17.2"
30+
"release-plan": "^0.18.0"
3131
},
32+
"packageManager": "pnpm@10.34.3",
3233
"volta": {
3334
"node": "24.13.0",
3435
"pnpm": "10.34.3"
35-
},
36-
"packageManager": "pnpm@10.34.3"
36+
}
3737
}

0 commit comments

Comments
 (0)