Skip to content

Commit

Permalink
Merge pull request #260 from embroider-build/update-release-plan-setup
Browse files Browse the repository at this point in the history
update release-plan
  • Loading branch information
mansona authored Feb 17, 2024
2 parents 9d9d979 + 1671550 commit 43f79e3
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 23 deletions.
32 changes: 21 additions & 11 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 Down Expand Up @@ -34,6 +34,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 @@ -43,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
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
title: Prepare Release
Expand All @@ -80,4 +90,4 @@ jobs:
-----------------------------------------
${{ steps.explanation.outputs.text }}
${{ steps.explanation.outputs.text }}
9 changes: 6 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 Down Expand Up @@ -38,6 +38,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 All @@ -47,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 All @@ -56,4 +59,4 @@ jobs:

env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
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 @@ -29,7 +29,7 @@
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.19.0",
"prettier": "^3.0.2",
"release-plan": "^0.5.1",
"release-plan": "^0.8.0",
"typescript": "^4.7.4"
},
"engines": {
Expand Down
96 changes: 89 additions & 7 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 43f79e3

Please sign in to comment.