1- name : Release Plan Review
1+ name : Plan Release
22on :
3+ workflow_dispatch :
34 push :
45 branches :
56 - main
@@ -14,74 +15,44 @@ concurrency:
1415 cancel-in-progress : true
1516
1617jobs :
17- check- plan :
18- name : " Check Release Plan "
18+ should-run-release- plan-prepare :
19+ name : Should we run release-plan prepare?
1920 runs-on : ubuntu-latest
2021 outputs :
21- command : ${{ steps.check-release.outputs.command }}
22-
22+ should-prepare : ${{ steps.should-prepare.outputs.should-prepare }}
2323 steps :
24- - uses : actions/checkout@v6
24+ - uses : release-plan/ actions/should-prepare-release@v1
2525 with :
26- fetch-depth : 0
2726 ref : ' master'
28- # This will only cause the `check-plan` job to have a "command" of `release`
29- # when the .release-plan.json file was changed on the last commit.
30- - id : check-release
31- 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
3228
33- prepare_release_notes :
34- name : Prepare Release Notes
29+ create-prepare-release-pr :
30+ name : Create Prepare Release PR
3531 runs-on : ubuntu-latest
3632 timeout-minutes : 5
37- needs : check- plan
33+ needs : should-run-release- plan-prepare
3834 permissions :
3935 contents : write
4036 issues : read
4137 pull-requests : write
42- outputs :
43- explanation : ${{ steps.explanation.outputs.text }}
44- # only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
45- # only run on labeled event if the PR has already been merged
46- if : (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
47-
38+ if : needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
4839 steps :
49- - uses : actions/checkout@v6
50- # We need to download lots of history so that
51- # github-changelog can discover what's changed since the last release
40+ - uses : release-plan/actions/prepare@v1
41+ name : Run release-plan prepare
5242 with :
53- fetch-depth : 0
5443 ref : ' master'
55- - uses : pnpm/action-setup@v4
56- - uses : actions/setup-node@v6
57- with :
58- node-version : 18
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@v7
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
0 commit comments