@@ -15,77 +15,44 @@ concurrency:
1515 cancel-in-progress : true
1616
1717jobs :
18- is-this-a- release :
19- name : ' Is this a release? '
18+ should-run- release-plan-prepare :
19+ name : Should we run release-plan prepare?
2020 runs-on : ubuntu-latest
2121 outputs :
22- command : ${{ steps.check-release.outputs.command }}
23-
22+ should-prepare : ${{ steps.should-prepare.outputs.should-prepare }}
2423 steps :
25- - uses : actions/checkout@v4
24+ - uses : release-plan/ actions/should-prepare-release@v1
2625 with :
27- fetch-depth : 2
2826 ref : ' main'
29- # This will only cause the `is-this-a-release` job to have a "command" of `release`
30- # when the .release-plan.json file was changed on the last commit.
31- - id : check-release
32- 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
3328
3429 create-prepare-release-pr :
3530 name : Create Prepare Release PR
3631 runs-on : ubuntu-latest
3732 timeout-minutes : 5
38- needs : is-this-a- release
33+ needs : should-run- release-plan-prepare
3934 permissions :
4035 contents : write
4136 issues : read
4237 pull-requests : write
43- # only run on push event or workflow dispatch if plan wasn't updated (don't create a release plan when we're releasing)
44- # only run on labeled event if the PR has already been merged
45- if : ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && needs.is-this-a-release.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
46-
38+ if : needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
4739 steps :
48- - uses : actions/checkout@v4
49- # We need to download lots of history so that
50- # github-changelog can discover what's changed since the last release
40+ - uses : release-plan/actions/prepare@v1
41+ name : Run release-plan prepare
5142 with :
52- fetch-depth : 0
5343 ref : ' main'
54- - uses : pnpm/action-setup@v4
55- - uses : actions/setup-node@v4
56- with :
57- node-version : 18
58- cache : pnpm
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- release_plan_output=$(cat release-plan-stderr.txt)
68- else
69- release_plan_output=$(jq .description .release-plan.json -r)
70- rm release-plan-stderr.txt
71-
72- if [ $(jq '.solution | length' .release-plan.json) -eq 1 ]; then
73- new_version=$(jq -r '.solution[].newVersion' .release-plan.json)
74- echo "new_version=v$new_version" >> $GITHUB_OUTPUT
75- fi
76- fi
77- echo 'text<<EOF' >> $GITHUB_OUTPUT
78- echo "$release_plan_output" >> $GITHUB_OUTPUT
79- echo 'EOF' >> $GITHUB_OUTPUT
8044 env :
8145 GITHUB_AUTH : ${{ secrets.GITHUB_TOKEN }}
46+ id : explanation
8247
83- - uses : peter-evans/create-pull-request@v7
48+ - uses : peter-evans/create-pull-request@v8
49+ name : Create Prepare Release PR
8450 with :
85- commit-message : " Prepare Release ${{ steps.explanation.outputs.new_version }} using 'release-plan'"
51+ commit-message : " Prepare Release ${{ steps.explanation.outputs.new-version }} using 'release-plan'"
8652 labels : ' internal'
53+ sign-commits : true
8754 branch : release-preview
88- title : Prepare Release ${{ steps.explanation.outputs.new_version }}
55+ title : Prepare Release ${{ steps.explanation.outputs.new-version }}
8956 body : |
9057 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 👍
9158
0 commit comments