Skip to content

Commit

Permalink
Merge pull request #1824 from embroider-build/update-release-plan
Browse files Browse the repository at this point in the history
update release-plan
  • Loading branch information
NullVoxPopuli authored Feb 28, 2024
2 parents f60adbb + b66a07a commit 2f460dc
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# For every push to the master branch, this checks if the release-plan was
# updated and if it was it will publish stable npm packages based on the
# release plan
# release plan

name: Publish Stable

Expand Down Expand Up @@ -28,7 +28,7 @@ jobs:
ref: 'stable'
# This will only cause the `check-plan` job to have a result of `success`
# when the .release-plan.json file was changed on the last commit. This
# plus the fact that this action only runs on main will be enough of a guard
# plus the fact that this action only runs on stable will be enough of a guard
- id: check-release
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT

Expand All @@ -37,6 +37,9 @@ jobs:
runs-on: ubuntu-latest
needs: check-plan
if: needs.check-plan.outputs.command == 'release'
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/release-plan-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- labeled

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

jobs:
Expand All @@ -33,6 +33,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: check-plan
permissions:
contents: write
pull-requests: write
outputs:
explanation: ${{ steps.explanation.outputs.text }}
# only run on push event if plan wasn't updated (don't create a release plan when we're releasing)
Expand All @@ -42,7 +45,7 @@ jobs:
steps:
- uses: actions/checkout@v4
# We need to download lots of history so that
# lerna-changelog can discover what's changed since the last release
# github-changelog can discover what's changed since the last release
with:
fetch-depth: 0
- uses: ./.github/actions/setup
Expand All @@ -52,20 +55,26 @@ jobs:
- name: "Generate Explanation and Prep Changelogs"
id: explanation
run: |
set -x
set +e
pnpm release-plan prepare
pnpm release-plan prepare 2> >(tee -a stderr.log >&2)
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat stderr.log >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
commit-message: "Prepare Release using 'release-plan'"
author: "github-actions[bot] <[email protected]>"
labels: "internal"
branch: release-preview-stable
title: Prepare Release
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Process

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.
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.

## Preparation

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.2.1",
"prettier": "^2.3.1",
"release-plan": "^0.6.0",
"release-plan": "^0.8.0",
"typescript": "^5.1.6"
},
"publishConfig": {
Expand Down
19 changes: 8 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2f460dc

Please sign in to comment.