Skip to content

Commit 9dcd7b0

Browse files
committed
update release-plan
1 parent 89d4923 commit 9dcd7b0

File tree

5 files changed

+422
-179
lines changed

5 files changed

+422
-179
lines changed

.github/workflows/plan-release.yml

+24-13
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414

1515
jobs:
1616
check-plan:
17-
name: 'Check Release Plan'
17+
name: "Check Release Plan"
1818
runs-on: ubuntu-latest
1919
outputs:
2020
command: ${{ steps.check-release.outputs.command }}
@@ -34,6 +34,9 @@ jobs:
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 5
3636
needs: check-plan
37+
permissions:
38+
contents: write
39+
pull-requests: write
3740
outputs:
3841
explanation: ${{ steps.explanation.outputs.text }}
3942
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
@@ -43,33 +46,41 @@ jobs:
4346
steps:
4447
- uses: actions/checkout@v4
4548
# We need to download lots of history so that
46-
# lerna-changelog can discover what's changed since the last release
49+
# github-changelog can discover what's changed since the last release
4750
with:
4851
fetch-depth: 0
52+
ref: 'main'
4953
- uses: actions/setup-node@v4
5054
with:
5155
node-version: 16
5256

5357
- run: npm ci
54-
55-
- name: 'Generate Explanation and Prep Changelogs'
58+
59+
- name: "Generate Explanation and Prep Changelogs"
5660
id: explanation
5761
run: |
58-
set -x
59-
60-
npx release-plan prepare
62+
set +e
63+
64+
npx release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
65+
6166
62-
echo 'text<<EOF' >> $GITHUB_OUTPUT
63-
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
64-
echo 'EOF' >> $GITHUB_OUTPUT
67+
if [ $? -ne 0 ]; then
68+
echo 'text<<EOF' >> $GITHUB_OUTPUT
69+
cat release-plan-stderr.txt >> $GITHUB_OUTPUT
70+
echo 'EOF' >> $GITHUB_OUTPUT
71+
else
72+
echo 'text<<EOF' >> $GITHUB_OUTPUT
73+
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
74+
echo 'EOF' >> $GITHUB_OUTPUT
75+
rm release-plan-stderr.txt
76+
fi
6577
env:
6678
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
6779

68-
- uses: peter-evans/create-pull-request@v5
80+
- uses: peter-evans/create-pull-request@v6
6981
with:
7082
commit-message: "Prepare Release using 'release-plan'"
71-
author: 'github-actions[bot] <github-actions-bot@users.noreply.github.com>'
72-
labels: 'internal'
83+
labels: "internal"
7384
branch: release-preview
7485
title: Prepare Release
7586
body: |

.github/workflows/publish.yml

+8-5
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,10 +34,13 @@ 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'
41+
permissions:
42+
contents: write
43+
pull-requests: write
4144

4245
steps:
4346
- uses: actions/checkout@v4
@@ -46,11 +49,11 @@ jobs:
4649
node-version: 18
4750
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
4851
registry-url: 'https://registry.npmjs.org'
49-
52+
5053
- run: npm ci
5154
- name: npm publish
5255
run: npx release-plan publish
53-
56+
5457
env:
5558
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
5659
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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

0 commit comments

Comments
 (0)