Skip to content

Commit 51b2eb9

Browse files
committed
Bump release-plan and update setup
1 parent b34b37d commit 51b2eb9

File tree

5 files changed

+150
-261
lines changed

5 files changed

+150
-261
lines changed

.github/workflows/plan-release.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ on:
44
branches:
55
- main
66
- master
7-
pull_request:
7+
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/
88
types:
99
- labeled
10+
- unlabeled
1011

1112
concurrency:
1213
group: plan-release # only the latest one of these should ever be running
1314
cancel-in-progress: true
1415

1516
jobs:
1617
check-plan:
17-
name: 'Check Release Plan'
18+
name: "Check Release Plan"
1819
runs-on: ubuntu-latest
1920
outputs:
2021
command: ${{ steps.check-release.outputs.command }}
@@ -36,44 +37,49 @@ jobs:
3637
needs: check-plan
3738
permissions:
3839
contents: write
40+
issues: read
3941
pull-requests: write
4042
outputs:
4143
explanation: ${{ steps.explanation.outputs.text }}
4244
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
4345
# 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)
46+
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
4547

4648
steps:
4749
- uses: actions/checkout@v4
4850
# We need to download lots of history so that
49-
# lerna-changelog can discover what's changed since the last release
51+
# github-changelog can discover what's changed since the last release
5052
with:
5153
fetch-depth: 0
54+
ref: 'master'
5255
- uses: actions/setup-node@v4
5356
with:
54-
node-version: 20.x
55-
57+
node-version: 18
5658
- uses: pnpm/action-setup@v4
5759
- run: pnpm install --frozen-lockfile
58-
59-
- name: 'Generate Explanation and Prep Changelogs'
60+
- name: "Generate Explanation and Prep Changelogs"
6061
id: explanation
6162
run: |
62-
set -x
63-
64-
pnpm release-plan prepare
63+
set +e
64+
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
6565
66-
echo 'text<<EOF' >> $GITHUB_OUTPUT
67-
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
68-
echo 'EOF' >> $GITHUB_OUTPUT
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
6976
env:
7077
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
7178

72-
- uses: peter-evans/create-pull-request@v5
79+
- uses: peter-evans/create-pull-request@v6
7380
with:
7481
commit-message: "Prepare Release using 'release-plan'"
75-
author: 'github-actions[bot] <[email protected]>'
76-
labels: 'internal'
82+
labels: "internal"
7783
branch: release-preview
7884
title: Prepare Release
7985
body: |

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For every push to the master branch, this checks if the release-plan was
22
# updated and if it was it will publish stable npm packages based on the
3-
# release plan
3+
# release plan
44

55
name: Publish Stable
66

@@ -17,7 +17,7 @@ concurrency:
1717

1818
jobs:
1919
check-plan:
20-
name: 'Check Release Plan'
20+
name: "Check Release Plan"
2121
runs-on: ubuntu-latest
2222
outputs:
2323
command: ${{ steps.check-release.outputs.command }}
@@ -34,7 +34,7 @@ jobs:
3434
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
3535

3636
publish:
37-
name: 'NPM Publish'
37+
name: "NPM Publish"
3838
runs-on: ubuntu-latest
3939
needs: check-plan
4040
if: needs.check-plan.outputs.command == 'release'
@@ -46,15 +46,13 @@ jobs:
4646
- uses: actions/checkout@v4
4747
- uses: actions/setup-node@v4
4848
with:
49-
node-version: 20.x
49+
node-version: 18
5050
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
5151
registry-url: 'https://registry.npmjs.org'
52-
5352
- uses: pnpm/action-setup@v4
5453
- run: pnpm install --frozen-lockfile
5554
- name: npm publish
5655
run: pnpm release-plan publish
57-
5856
env:
5957
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
6058
NODE_AUTH_TOKEN: ${{ secrets.NPM_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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"eslint-plugin-qunit": "^6.2.0",
8686
"npm-run-all": "^4.1.5",
8787
"prettier": "^2.5.1",
88-
"release-plan": "^0.7.0",
88+
"release-plan": "^0.10.0",
8989
"rollup": "^4.22.4",
9090
"scenario-tester": "^3.1.0"
9191
},

0 commit comments

Comments
 (0)