Skip to content

Commit

Permalink
Merge pull request #107 from ember-tooling/update-release-plan
Browse files Browse the repository at this point in the history
Update release-plan
  • Loading branch information
NullVoxPopuli authored Nov 22, 2024
2 parents 5b4ca59 + f527d8c commit cbed9e0
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 286 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
branches:
- main
- master
pull_request:
types:
pull_request_target: # This workflow has permissions on the repo, do NOT run code from PRs in this workflow. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
types:
- labeled
- unlabeled

concurrency:
group: plan-release # only the latest one of these should ever be running
Expand Down Expand Up @@ -34,44 +35,50 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: check-plan
permissions:
contents: write
issues: read
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)
if: (github.event_name == 'push' && needs.check-plan.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)

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
with:
version: 8
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile

- name: "Generate Explanation and Prep Changelogs"
id: explanation
run: |
set -x
pnpm release-plan prepare --singlePackage=ember-eslint-parser
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
set +e
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat release-plan-stderr.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
rm release-plan-stderr.txt
fi
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

- uses: peter-evans/create-pull-request@v6
with:
commit-message: "Prepare Release using 'release-plan'"
author: "github-actions[bot] <github-actions-bot@users.noreply.github.com>"
labels: "internal"
branch: release-preview
title: Prepare Release
Expand Down
13 changes: 6 additions & 7 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 @@ -46,14 +49,10 @@ 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
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- name: npm publish
run: pnpm release-plan publish --singlePackage=ember-eslint-parser

run: pnpm release-plan publish
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions 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 All @@ -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/NullVoxPopuli/ember-eslint-parser/pulls?q=is%3Apr+is%3Aopen+%22Prepare+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/ember-tooling/ember-eslint-parser/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
"src"
],
"scripts": {
"test": "vitest run",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:js": "eslint . --max-warnings=0",
"lint:js:fix": "eslint . --fix --max-warnings=0",
"lint:package": "pnpm publint",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:js:fix": "eslint . --fix --max-warnings=0"
"test": "vitest run"
},
"dependencies": {
"@babel/eslint-parser": "^7.23.10",
"@glimmer/syntax": "^0.92.0",
"content-tag": "^2.0.1",
"eslint-scope": "^7.2.2",
"html-tags": "^3.3.1",
"svg-tags": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.23.6",
Expand All @@ -42,27 +50,11 @@
"fs-extra": "^11.2.0",
"prettier": "^3.2.5",
"publint": "^0.2.6",
"release-plan": "^0.8.0",
"release-plan": "^0.9.0",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vitest": "^1.2.2"
},
"dependencies": {
"@babel/eslint-parser": "^7.23.10",
"@glimmer/syntax": "^0.92.0",
"content-tag": "^2.0.1",
"eslint-scope": "^7.2.2",
"html-tags": "^3.3.1",
"svg-tags": "^1.0.0"
},
"engines": {
"node": ">=16.0.0"
},
"pnpm": {
"overrides": {
"ember-eslint-parser": "workspace:*"
}
},
"peerDependencies": {
"@babel/core": "^7.23.6",
"@typescript-eslint/parser": "*"
Expand All @@ -71,5 +63,14 @@
"@typescript-eslint/parser": {
"optional": true
}
},
"packageManager": "pnpm@9.13.2",
"engines": {
"node": ">=16.0.0"
},
"pnpm": {
"overrides": {
"ember-eslint-parser": "workspace:*"
}
}
}
Loading

0 comments on commit cbed9e0

Please sign in to comment.