88 types :
99 - labeled
1010 - unlabeled
11- branches :
12- - release
1311
1412concurrency :
1513 group : plan-release-stable # only the latest one of these should ever be running
1614 cancel-in-progress : true
1715
1816jobs :
19- is-this-a- release :
20- name : " Is this a release? "
17+ should-run- release-plan-prepare :
18+ name : Should we run release-plan prepare?
2119 runs-on : ubuntu-latest
2220 outputs :
23- command : ${{ steps.check-release.outputs.command }}
24-
21+ should-prepare : ${{ steps.should-prepare.outputs.should-prepare }}
2522 steps :
26- - uses : actions/checkout@v4
23+ - uses : release-plan/ actions/should-prepare-release@v1
2724 with :
28- fetch-depth : 2
2925 ref : " release"
30- # This will only cause the `is-this-a-release` job to have a "command" of `release`
31- # when the .release-plan.json file was changed on the last commit.
32- - id : check-release
33- run : if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
26+ id : should-prepare
3427
3528 create-prepare-release-pr :
3629 name : Create Prepare Release PR
3730 runs-on : ubuntu-latest
3831 timeout-minutes : 5
39- needs : is-this-a- release
32+ needs : should-run- release-plan-prepare
4033 permissions :
4134 contents : write
4235 issues : read
4336 pull-requests : write
44- # only run on push event or workflow dispatch 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' || 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)
47-
37+ if : needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
4838 steps :
49- - uses : actions/checkout@v4
50- # We need to download lots of history so that
51- # github-changelog can discover what's changed since the last release
39+ - uses : release-plan/actions/prepare@v1
40+ name : Run release-plan prepare
5241 with :
53- fetch-depth : 0
5442 ref : " release"
55- - uses : pnpm/action-setup@v4
56- - uses : actions/setup-node@v4
57- with :
58- node-version : 20
59- cache : pnpm
60- - run : pnpm install --frozen-lockfile
61- - name : " Generate Explanation and Prep Changelogs"
62- id : explanation
63- run : |
64- set +e
65- pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
66-
67- if [ $? -ne 0 ]; then
68- release_plan_output=$(cat release-plan-stderr.txt)
69- else
70- release_plan_output=$(jq .description .release-plan.json -r)
71- rm release-plan-stderr.txt
72-
73- if [ $(jq '.solution | length' .release-plan.json) -eq 1 ]; then
74- new_version=$(jq -r '.solution[].newVersion' .release-plan.json)
75- echo "new_version=v$new_version" >> $GITHUB_OUTPUT
76- fi
77- fi
78- echo 'text<<EOF' >> $GITHUB_OUTPUT
79- echo "$release_plan_output" >> $GITHUB_OUTPUT
80- echo 'EOF' >> $GITHUB_OUTPUT
8143 env :
8244 GITHUB_AUTH : ${{ secrets.GITHUB_TOKEN }}
45+ id : explanation
8346
8447 # this is needed because our fixtures are highly dependent on the exact version of ember-cli in the monorepo
8548 # and release-plan updates the version during the plan phase
@@ -89,12 +52,14 @@ jobs:
8952 run : |
9053 sed -i 's/"ember-cli".*/"ember-cli": "~'$(jq -r .version package.json)'",/' packages/app-blueprint/files/package.json
9154
92- - uses : peter-evans/create-pull-request@v7
55+ - uses : peter-evans/create-pull-request@v8
56+ name : Create Prepare Release PR
9357 with :
94- commit-message : " Prepare Stable Release ${{ steps.explanation.outputs.new_version }} using 'release-plan'"
58+ commit-message : " Prepare Stable Release ${{ steps.explanation.outputs.new-version }} using 'release-plan'"
9559 labels : " internal"
60+ sign-commits : true
9661 branch : release-preview-stable
97- title : Prepare Stable Release ${{ steps.explanation.outputs.new_version }}
62+ title : Prepare Stable Release ${{ steps.explanation.outputs.new-version }}
9863 # this doesn't use secrets.GITHUB_TOKEN because we want CI to run on the PR that it opens.
9964 # See: https://docs.github.com/en/actions/how-tos/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
10065 token : ${{ secrets.RELEASE_PLAN_GH_PAT }}
0 commit comments