Skip to content

Commit f2df762

Browse files
Add Release plan (#1703)
* Remove release-it * Add release-plan
1 parent 3a39d36 commit f2df762

File tree

7 files changed

+479
-1348
lines changed

7 files changed

+479
-1348
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Node
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 18
25+
node-version: 20
2626
cache: pnpm
2727
- run: pnpm i
2828
- run: pnpm test

.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: 'master'
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: 'master'
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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
with:
32+
version: 10
33+
- uses: actions/setup-node@v6
34+
with:
35+
node-version: 20
36+
registry-url: 'https://registry.npmjs.org'
37+
cache: pnpm
38+
- run: pnpm install --frozen-lockfile
39+
- run: npm install -g npm@latest # ensure that the globally installed npm is new enough to support OIDC
40+
- name: Publish to NPM
41+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
42+
env:
43+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}

.release-it.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

RELEASE.md

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,27 @@
11
# Release Process
22

3-
Releases are mostly automated using
4-
[release-it](https://github.com/release-it/release-it/) and
5-
[lerna-changelog](https://github.com/lerna/lerna-changelog/).
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.
64

75
## Preparation
86

9-
Since the majority of the actual release process is automated, the primary
10-
remaining task prior to releasing is confirming that all pull requests that
11-
have been merged since the last release have been labeled with the appropriate
12-
`lerna-changelog` labels and the titles have been updated to ensure they
13-
represent something that would make sense to our users. Some great information
14-
on why this is important can be found at
15-
[keepachangelog.com](https://keepachangelog.com/en/1.0.0/), but the overall
16-
guiding principle here is that changelogs are for humans, not machines.
17-
18-
When reviewing merged PR's the labels to be used are:
19-
20-
* breaking - Used when the PR is considered a breaking change.
21-
* enhancement - Used when the PR adds a new feature or enhancement.
22-
* bug - Used when the PR fixes a bug included in a previous release.
23-
* documentation - Used when the PR adds or updates documentation.
24-
* internal - Used for internal changes that still require a mention in the
25-
changelog/release notes.
26-
27-
## Release
7+
Since the majority of the actual release process is automated, the remaining tasks before releasing are:
288

29-
Once the prep work is completed, the actual release is straight forward:
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
3011

31-
* First, ensure that you have installed your projects dependencies:
32-
33-
```sh
34-
pnpm install
35-
```
36-
37-
* Second, ensure that you have obtained a
38-
[GitHub personal access token][generate-token] with the `repo` scope (no
39-
other permissions are needed). Make sure the token is available as the
40-
`GITHUB_AUTH` environment variable.
41-
42-
For instance:
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.
4314

44-
```bash
45-
export GITHUB_AUTH=abc123def456
46-
```
15+
When reviewing merged PR's the labels to be used are:
4716

48-
[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable
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.
4922

50-
* And last (but not least 😁) do your release.
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`
5124

52-
```sh
53-
npx release-it
54-
```
25+
## Release
5526

56-
[release-it](https://github.com/release-it/release-it/) manages the actual
57-
release process. It will prompt you to to choose the version number after which
58-
you will have the chance to hand tweak the changelog to be used (for the
59-
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
60-
pushing the tag and commits, etc.
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/shipshapecode/tether/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
"name": "tether",
33
"version": "2.0.0",
44
"description": "A client-side library to make absolutely positioned elements attach to elements in the page efficiently.",
5-
"authors": [
6-
"Zack Bloom <[email protected]>",
7-
"Adam Schwartz <[email protected]>"
8-
],
95
"repository": {
106
"type": "git",
117
"url": "https://github.com/shipshapecode/tether.git"
@@ -37,7 +33,6 @@
3733
"devDependencies": {
3834
"@babel/core": "^7.28.5",
3935
"@babel/preset-env": "^7.28.5",
40-
"@release-it-plugins/lerna-changelog": "^8.0.1",
4136
"@testing-library/jest-dom": "^5.17.0",
4237
"autoprefixer": "^10.4.22",
4338
"babel-jest": "^29.7.0",
@@ -55,7 +50,7 @@
5550
"jsdom": "^27.2.0",
5651
"mutationobserver-shim": "^0.3.7",
5752
"postcss": "^8.5.6",
58-
"release-it": "^17.0.0",
53+
"release-plan": "^0.17.0",
5954
"rimraf": "^6.1.2",
6055
"rollup": "^2.79.2",
6156
"rollup-plugin-babel": "^4.4.0",
@@ -69,18 +64,22 @@
6964
"sinon": "^15.2.0",
7065
"start-server-and-test": "^2.1.3"
7166
},
72-
"publishConfig": {
73-
"registry": "https://registry.npmjs.org"
74-
},
7567
"engines": {
76-
"node": ">= 18",
68+
"node": ">= 20",
7769
"pnpm": ">= 10"
7870
},
71+
"publishConfig": {
72+
"registry": "https://registry.npmjs.org"
73+
},
7974
"pnpm": {
8075
"onlyBuiltDependencies": [
8176
"@parcel/watcher",
8277
"core-js",
8378
"cypress"
8479
]
85-
}
80+
},
81+
"authors": [
82+
"Zack Bloom <[email protected]>",
83+
"Adam Schwartz <[email protected]>"
84+
]
8685
}

0 commit comments

Comments
 (0)