Skip to content

Commit cf90a30

Browse files
committed
add release-plan
1 parent 85bb236 commit cf90a30

6 files changed

Lines changed: 1274 additions & 15 deletions

File tree

.github/workflows/plan-release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Plan Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
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/
9+
types:
10+
- labeled
11+
- unlabeled
12+
13+
concurrency:
14+
group: plan-release # only the latest one of these should ever be running
15+
cancel-in-progress: true
16+
17+
jobs:
18+
should-run-release-plan-prepare:
19+
name: Should we run release-plan prepare?
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should-prepare: ${{ steps.should-prepare.outputs.should-prepare }}
23+
steps:
24+
- uses: release-plan/actions/should-prepare-release@v1
25+
with:
26+
ref: 'main'
27+
id: should-prepare
28+
29+
create-prepare-release-pr:
30+
name: Create Prepare Release PR
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 5
33+
needs: should-run-release-plan-prepare
34+
permissions:
35+
contents: write
36+
issues: read
37+
pull-requests: write
38+
if: needs.should-run-release-plan-prepare.outputs.should-prepare == 'true'
39+
steps:
40+
- uses: release-plan/actions/prepare@v1
41+
name: Run release-plan prepare
42+
with:
43+
ref: 'main'
44+
env:
45+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
46+
id: explanation
47+
48+
- uses: peter-evans/create-pull-request@v7
49+
name: Create Prepare Release PR
50+
with:
51+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new-version}} using 'release-plan'"
52+
labels: "internal"
53+
sign-commits: true
54+
branch: release-preview
55+
title: Prepare Release ${{ steps.explanation.outputs.new-version }}
56+
body: |
57+
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 👍
58+
59+
-----------------------------------------
60+
61+
${{ steps.explanation.outputs.text }}

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# For every push to the primary branch with .release-plan.json modified,
2+
# runs release-plan.
3+
4+
name: Publish Stable
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
- master
12+
paths:
13+
- '.release-plan.json'
14+
15+
concurrency:
16+
group: publish-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
publish:
21+
name: "NPM Publish"
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
attestations: write
27+
28+
steps:
29+
- uses: actions/checkout@v5
30+
- uses: pnpm/action-setup@v4
31+
- uses: actions/setup-node@v6
32+
with:
33+
node-version: 22
34+
registry-url: 'https://registry.npmjs.org'
35+
cache: pnpm
36+
- run: pnpm install --frozen-lockfile
37+
- run: npm install -g npm@latest # ensure that the globally installed npm is new enough to support OIDC
38+
- name: Publish to NPM
39+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
40+
env:
41+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

RELEASE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Release Process
2+
3+
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.
4+
5+
## Preparation
6+
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
8+
9+
- correctly labeling **all** pull requests that have been merged since the last release
10+
- updating pull request titles so they make sense to our users
11+
12+
Some great information on why this is important can be found at [keepachangelog.com](https://keepachangelog.com/en/1.1.0/), but the overall
13+
guiding principle here is that changelogs are for humans, not machines.
14+
15+
When reviewing merged PR's the labels to be used are:
16+
17+
- breaking - Used when the PR is considered a breaking change.
18+
- enhancement - Used when the PR adds a new feature or enhancement.
19+
- bug - Used when the PR fixes a bug included in a previous release.
20+
- documentation - Used when the PR adds or updates documentation.
21+
- internal - Internal changes or things that don't fit in any other category.
22+
23+
**Note:** `release-plan` requires that **all** PRs are labeled. If a PR doesn't fit in a category it's fine to label it as `internal`
24+
25+
## Release
26+
27+
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-code-lens/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
"name": "ember-source-lens",
33
"version": "0.0.0",
4-
"description": "The default blueprint for Embroider v2 addons.",
5-
"packageManager": "pnpm@10.20.0",
4+
"description": "Ember Source Lens is a developer tool that allows you to click on rendered Ember components in the browser and jump directly to their source code in your editor.",
65
"keywords": [
76
"ember-addon"
87
],
9-
"type": "module",
10-
"repository": "",
8+
"repository": {
9+
"type": "git",
10+
"url": "git@github.com:ember-tooling/ember-code-lens.git"
11+
},
1112
"license": "MIT",
12-
"author": "",
13+
"author": "Liam Potter",
14+
"type": "module",
1315
"imports": {
1416
"#src/*": "./src/*"
1517
},
@@ -29,6 +31,7 @@
2931
],
3032
"scripts": {
3133
"build": "rollup --config",
34+
"dev": "pnpm start",
3235
"format": "prettier . --cache --write",
3336
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
3437
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
@@ -40,9 +43,8 @@
4043
"lint:types": "ember-tsc --noEmit",
4144
"prepack": "rollup --config",
4245
"start": "pnpm prepack && vite dev",
43-
"dev": "pnpm start",
44-
"test:app": "pnpm prepack && vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0",
4546
"test": "pnpm prepack && vitest",
47+
"test:app": "pnpm prepack && vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0",
4648
"test:ui": "pnpm prepack && vitest --ui"
4749
},
4850
"dependencies": {
@@ -105,6 +107,7 @@
105107
"prettier-plugin-ember-template-tag": "^2.0.4",
106108
"qunit": "^2.24.1",
107109
"qunit-dom": "^3.4.0",
110+
"release-plan": "^0.17.0",
108111
"rollup": "^4.22.5",
109112
"rollup-plugin-postcss": "^4.0.2",
110113
"testem": "^3.15.1",
@@ -114,6 +117,7 @@
114117
"vite-css-modules": "^1.11.1",
115118
"vitest": "^4.0.8"
116119
},
120+
"packageManager": "pnpm@10.20.0",
117121
"ember": {
118122
"edition": "octane"
119123
},

0 commit comments

Comments
 (0)