Skip to content

Commit d76cf7d

Browse files
committed
Update release-plan
1 parent 50bddb7 commit d76cf7d

5 files changed

Lines changed: 342 additions & 338 deletions

File tree

.github/workflows/plan-release.yml

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,58 @@
1-
name: Release Plan Review
1+
name: Plan Release
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main
67
- master
7-
pull_request:
8-
types:
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:
910
- labeled
11+
- unlabeled
1012

1113
concurrency:
1214
group: plan-release # only the latest one of these should ever be running
1315
cancel-in-progress: true
1416

1517
jobs:
16-
check-plan:
17-
name: "Check Release Plan"
18+
should-run-release-plan-prepare:
19+
name: Should we run release-plan prepare?
1820
runs-on: ubuntu-latest
1921
outputs:
20-
command: ${{ steps.check-release.outputs.command }}
21-
22+
should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
2223
steps:
23-
- uses: actions/checkout@v4
24+
- uses: release-plan/actions/should-prepare-release@v1
2425
with:
25-
fetch-depth: 0
2626
ref: 'master'
27-
# This will only cause the `check-plan` job to have a "command" of `release`
28-
# when the .release-plan.json file was changed on the last commit.
29-
- id: check-release
30-
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
3128

32-
prepare_release_notes:
33-
name: Prepare Release Notes
29+
create-prepare-release-pr:
30+
name: Create Prepare Release PR
3431
runs-on: ubuntu-latest
3532
timeout-minutes: 5
36-
needs: check-plan
33+
needs: should-run-release-plan-prepare
3734
permissions:
3835
contents: write
36+
issues: read
3937
pull-requests: write
40-
outputs:
41-
explanation: ${{ steps.explanation.outputs.text }}
42-
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
43-
# only run on labeled event if the PR has already been merged
44-
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
45-
38+
if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
4639
steps:
47-
- uses: actions/checkout@v4
48-
# We need to download lots of history so that
49-
# lerna-changelog can discover what's changed since the last release
40+
- uses: release-plan/actions/prepare@v1
41+
name: Run release-plan prepare
5042
with:
51-
fetch-depth: 0
52-
- uses: wyvox/action-setup-pnpm@v3
53-
54-
- name: "Generate Explanation and Prep Changelogs"
55-
id: explanation
56-
run: |
57-
set -x
58-
59-
pnpm release-plan prepare
60-
61-
echo 'text<<EOF' >> $GITHUB_OUTPUT
62-
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
63-
echo 'EOF' >> $GITHUB_OUTPUT
43+
ref: 'master'
6444
env:
6545
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
46+
id: explanation
6647

67-
- uses: peter-evans/create-pull-request@v5
48+
- uses: peter-evans/create-pull-request@v8
49+
name: Create Prepare Release PR
6850
with:
69-
commit-message: "Prepare Release using 'release-plan'"
70-
author: "github-actions[bot] <[email protected]>"
51+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
7152
labels: "internal"
53+
sign-commits: true
7254
branch: release-preview
73-
title: Prepare Release
55+
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
7456
body: |
7557
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 👍
7658

.github/workflows/publish.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
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

@@ -10,48 +9,32 @@ on:
109
branches:
1110
- main
1211
- master
12+
paths:
13+
- '.release-plan.json'
1314

1415
concurrency:
1516
group: publish-${{ github.head_ref || github.ref }}
1617
cancel-in-progress: true
1718

1819
jobs:
19-
check-plan:
20-
name: "Check Release Plan"
21-
runs-on: ubuntu-latest
22-
outputs:
23-
command: ${{ steps.check-release.outputs.command }}
24-
25-
steps:
26-
- uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 0
29-
ref: 'master'
30-
# This will only cause the `check-plan` job to have a result of `success`
31-
# when the .release-plan.json file was changed on the last commit. This
32-
# plus the fact that this action only runs on main will be enough of a guard
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
35-
3620
publish:
3721
name: "NPM Publish"
3822
runs-on: ubuntu-latest
39-
needs: check-plan
40-
if: needs.check-plan.outputs.command == 'release'
4123
permissions:
4224
contents: write
43-
pull-requests: write
25+
id-token: write
26+
attestations: write
4427

4528
steps:
46-
- uses: actions/checkout@v4
47-
- uses: wyvox/action-setup-pnpm@v3
29+
- uses: actions/checkout@v6
30+
- uses: pnpm/action-setup@v5
31+
- uses: actions/setup-node@v6
4832
with:
49-
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
50-
node-registry-url: 'https://registry.npmjs.org'
51-
52-
- name: npm publish
53-
run: pnpm release-plan publish
54-
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
5539
env:
5640
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
57-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

RELEASE.md

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

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 prepare the release once the PR is merged.
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.
44

55
## Preparation
66

7-
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
88

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
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
1111

1212
Some great information on why this is important can be found at [keepachangelog.com](https://keepachangelog.com/en/1.1.0/), but the overall
1313
guiding principle here is that changelogs are for humans, not machines.
1414

1515
When reviewing merged PR's the labels to be used are:
1616

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

2323
**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`
2424

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"test": "pnpm --filter '*' test"
1313
},
1414
"devDependencies": {
15-
"release-plan": "^0.6.0"
15+
"release-plan": "^0.18.0"
1616
},
1717
"packageManager": "[email protected]",
1818
"volta": {
@@ -24,16 +24,16 @@
2424
},
2525
"pnpm": {
2626
"peerDependencyRules": {
27+
"allowAny": [
28+
"typescript",
29+
"ember-source"
30+
],
2731
"ignoreMissing": [
2832
"rsvp",
2933
"webpack",
3034
"@babel/core",
3135
"ember-template-imports",
3236
"@glimmer/component"
33-
],
34-
"allowAny": [
35-
"typescript",
36-
"ember-source"
3737
]
3838
},
3939
"overrides": {
@@ -42,8 +42,8 @@
4242
},
4343
"notes": {
4444
"overrides": {
45-
"_": "these overrides only affect dev and not the published package",
46-
"@glimmer/*": "Glimmer is still pre 1.0, and every minor in pre-1.0 SemVer is a breaking chaneg. So because some dependencies (like 0.44.0 of Glimmer -- this is not compatible with current Glimmer (>= 0.80))"
45+
"@glimmer/*": "Glimmer is still pre 1.0, and every minor in pre-1.0 SemVer is a breaking chaneg. So because some dependencies (like 0.44.0 of Glimmer -- this is not compatible with current Glimmer (>= 0.80))",
46+
"_": "these overrides only affect dev and not the published package"
4747
}
4848
}
4949
}

0 commit comments

Comments
 (0)