Skip to content

Commit

Permalink
update release-plan
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Mar 11, 2024
1 parent 2751a09 commit 889fadc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 37 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
- master
pull_request:
types:
types:
- labeled

concurrency:
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'master'
ref: 'main'
# This will only cause the `check-plan` job to have a "command" of `release`
# when the .release-plan.json file was changed on the last commit.
- id: check-release
Expand All @@ -46,35 +46,42 @@ 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
ref: 'main'
- uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install --frozen-lockfile

- name: "Generate Explanation and Prep Changelogs"
id: explanation
run: |
set -x
pnpm release-plan prepare --singlePackage=@ef4/lerna-changelog
set +e
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
title: Prepare Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.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 All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'master'
ref: 'main'
# 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
Expand All @@ -50,7 +50,7 @@ jobs:
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- run: pnpm install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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

Since the majority of the actual release process is automated, the remaining tasks before releasing are:
Since the majority of the actual release process is automated, the remaining tasks before releasing are:

- correctly labeling **all** pull requests that have been merged since the last release
- updating pull request titles so they make sense to our users
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"jest": "28.1.3",
"jest-runner-eslint": "2.1.2",
"prettier": "2.8.8",
"release-plan": "^0.6.0",
"release-plan": "^0.8.0",
"rimraf": "3.0.2",
"ts-jest": "29.1.1",
"typescript": "5.0.4"
Expand Down
26 changes: 9 additions & 17 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 889fadc

Please sign in to comment.