Skip to content

Commit

Permalink
Merge pull request #374 from mansona/update-release-plan
Browse files Browse the repository at this point in the history
update release-plan
  • Loading branch information
mansona authored Feb 6, 2024
2 parents 9682278 + 68e20a1 commit 1d37f83
Show file tree
Hide file tree
Showing 5 changed files with 283 additions and 300 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,45 @@ on:
push:
branches:
- main
- master
pull_request:
types:
- labeled

concurrency:
group: plan-release-${{ github.head_ref || github.ref }}
group: plan-release # only the latest one of these should ever be running
cancel-in-progress: true

jobs:
check-plan:
name: "Check Release Plan"
runs-on: ubuntu-latest
outputs:
command: ${{ steps.check-release.outputs.command }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
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
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT

prepare_release_notes:
name: Prepare Release Notes
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)
# only run on labeled event if the PR has already been merged
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)

steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +63,7 @@ jobs:
run: |
set -x
pnpm release-plan prepare --singlePackage=ember-cli-notifications
pnpm release-plan prepare
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
Expand All @@ -53,7 +77,7 @@ jobs:
author: "github-actions[bot] <[email protected]>"
labels: "internal"
branch: release-preview
title: Release Preview
title: Prepare Release
body: |
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 👍
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
command: ${{ steps.check-release.outputs.command }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'main'
Expand All @@ -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 @@ -46,14 +49,14 @@ jobs:
node-version: 18
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install --frozen-lockfile
- name: npm publish
run: pnpm release-plan publish

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
Expand Up @@ -24,4 +24,4 @@ When reviewing merged PR's the labels to be used are:

## Release

Once the prep work is completed, the actual release is straight forward: you just need to merge the open [Plan Release](https://github.com/mansona/ember-cli-notifications/pulls?q=is%3Apr+is%3Aopen+%22Plan+Release%22+in%3Atitle) PR
Once the prep work is completed, the actual release is straight forward: you just need to merge the open [Plan Release](https://github.com/mansona/ember-cli-notifications/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"concurrently": "^8.2.0",
"prettier": "^3.0.3",
"prettier-plugin-ember-template-tag": "^1.1.0",
"release-plan": "^0.3.0"
"release-plan": "^0.7.0"
},
"pnpm": {
"overrides": {
Expand Down
Loading

0 comments on commit 1d37f83

Please sign in to comment.