Skip to content

Commit ee14c8b

Browse files
Merge pull request #2 from universal-ember/release-plan
Release plan
2 parents 81bad1d + 5f983d3 commit ee14c8b

9 files changed

Lines changed: 1346 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
- uses: pnpm/action-setup@v4
2323
- uses: actions/setup-node@v4
2424
with:
25-
node-version: 18
2625
cache: pnpm
2726
- name: Install Dependencies
2827
run: pnpm install --frozen-lockfile
@@ -41,7 +40,6 @@ jobs:
4140
- uses: pnpm/action-setup@v4
4241
- uses: actions/setup-node@v4
4342
with:
44-
node-version: 18
4543
cache: pnpm
4644
- name: Install Dependencies
4745
run: pnpm install --frozen-lockfile
@@ -51,7 +49,7 @@ jobs:
5149
- id: set-matrix
5250
run: |
5351
echo "matrix=$(pnpm -s dlx @embroider/try list)" >> $GITHUB_OUTPUT
54-
52+
5553
5654
floating:
5755
name: "Floating Dependencies"
@@ -63,7 +61,6 @@ jobs:
6361
- uses: pnpm/action-setup@v4
6462
- uses: actions/setup-node@v4
6563
with:
66-
node-version: 18
6764
cache: pnpm
6865
- name: Install Dependencies
6966
run: pnpm install --no-lockfile
@@ -84,16 +81,15 @@ jobs:
8481
- uses: pnpm/action-setup@v4
8582
- uses: actions/setup-node@v4
8683
with:
87-
node-version: 18
8884
cache: pnpm
8985
- name: Apply Scenario
9086
run: |
9187
pnpm dlx @embroider/try apply ${{ matrix.name }}
92-
88+
9389
- name: Install Dependencies
9490
run: pnpm install --no-lockfile
9591
- name: Run Tests
9692
run: |
9793
pnpm test
98-
94+
9995
env: ${{ matrix.env }}

.github/workflows/plan-release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
is-this-a-release:
19+
name: "Is this a release?"
20+
runs-on: ubuntu-latest
21+
outputs:
22+
command: ${{ steps.check-release.outputs.command }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 2
28+
ref: 'main'
29+
# This will only cause the `is-this-a-release` job to have a "command" of `release`
30+
# when the .release-plan.json file was changed on the last commit.
31+
- id: check-release
32+
run: if git diff --name-only HEAD HEAD~1 | grep -w -q ".release-plan.json"; then echo "command=release"; fi >> $GITHUB_OUTPUT
33+
34+
create-prepare-release-pr:
35+
name: Create Prepare Release PR
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 5
38+
needs: is-this-a-release
39+
permissions:
40+
contents: write
41+
issues: read
42+
pull-requests: write
43+
# only run on push event or workflow dispatch if plan wasn't updated (don't create a release plan when we're releasing)
44+
# only run on labeled event if the PR has already been merged
45+
if: ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && needs.is-this-a-release.outputs.command != 'release') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
# We need to download lots of history so that
50+
# github-changelog can discover what's changed since the last release
51+
with:
52+
fetch-depth: 0
53+
ref: 'main'
54+
- uses: pnpm/action-setup@v4
55+
- uses: actions/setup-node@v4
56+
with:
57+
cache: pnpm
58+
- run: pnpm install --frozen-lockfile
59+
- name: "Generate Explanation and Prep Changelogs"
60+
id: explanation
61+
run: |
62+
set +e
63+
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
64+
65+
if [ $? -ne 0 ]; then
66+
release_plan_output=$(cat release-plan-stderr.txt)
67+
else
68+
release_plan_output=$(jq .description .release-plan.json -r)
69+
rm release-plan-stderr.txt
70+
71+
if [ $(jq '.solution | length' .release-plan.json) -eq 1 ]; then
72+
new_version=$(jq -r '.solution[].newVersion' .release-plan.json)
73+
echo "new_version=v$new_version" >> $GITHUB_OUTPUT
74+
fi
75+
fi
76+
echo 'text<<EOF' >> $GITHUB_OUTPUT
77+
echo "$release_plan_output" >> $GITHUB_OUTPUT
78+
echo 'EOF' >> $GITHUB_OUTPUT
79+
env:
80+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
81+
82+
- uses: peter-evans/create-pull-request@v7
83+
with:
84+
commit-message: "Prepare Release ${{ steps.explanation.outputs.new_version}} using 'release-plan'"
85+
labels: "internal"
86+
branch: release-preview
87+
title: Prepare Release ${{ steps.explanation.outputs.new_version }}
88+
body: |
89+
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 👍
90+
91+
-----------------------------------------
92+
93+
${{ steps.explanation.outputs.text }}

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
pull-requests: write
26+
id-token: write
27+
attestations: write
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: pnpm/action-setup@v4
32+
- uses: actions/setup-node@v4
33+
with:
34+
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
35+
registry-url: 'https://registry.npmjs.org'
36+
cache: pnpm
37+
- run: pnpm install --frozen-lockfile
38+
- name: Publish to NPM
39+
run: NPM_CONFIG_PROVENANCE=true pnpm release-plan publish
40+
env:
41+
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/push-dist.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- uses: pnpm/action-setup@v4
2525
- uses: actions/setup-node@v4
2626
with:
27-
node-version: 18
2827
cache: pnpm
2928
- name: Install Dependencies
3029
run: pnpm install --frozen-lockfile

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/universal-ember/react/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,35 @@
55
"keywords": [
66
"ember-addon"
77
],
8-
"repository": "",
8+
"repository": {
9+
"type": "git",
10+
"url": "git@github.com:universal-ember/react.git"
11+
},
912
"license": "MIT",
1013
"author": "",
14+
"imports": {
15+
"#src/*": "./src/*",
16+
"#react/*": "./tests/react/*"
17+
},
18+
"exports": {
19+
".": {
20+
"types": "./declarations/index.d.ts",
21+
"default": "./dist/index.js"
22+
},
23+
"./*.css": "./dist/*.css",
24+
"./*": {
25+
"types": "./declarations/*.d.ts",
26+
"default": "./dist/*.js"
27+
},
28+
"./addon-main.js": "./addon-main.cjs"
29+
},
30+
"typesVersions": {
31+
"*": {
32+
"*": [
33+
"declarations/*"
34+
]
35+
}
36+
},
1137
"files": [
1238
"addon-main.cjs",
1339
"declarations",
@@ -20,13 +46,13 @@
2046
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
2147
"lint:format": "prettier . --cache --check",
2248
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
23-
"lint:js": "eslint . --cache",
2449
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
50+
"lint:js": "eslint . --cache",
2551
"lint:js:fix": "eslint . --fix",
2652
"lint:types": "glint",
53+
"prepack": "rollup --config",
2754
"start": "vite dev",
28-
"test": "vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0",
29-
"prepack": "rollup --config"
55+
"test": "vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0"
3056
},
3157
"dependencies": {
3258
"@ember/test-waiters": "^4.1.1",
@@ -72,45 +98,23 @@
7298
"qunit-dom": "^3.4.0",
7399
"react": "^19.1.0",
74100
"react-dom": "^19.1.0",
101+
"release-plan": "^0.16.0",
75102
"rollup": "^4.22.5",
76103
"testem": "^3.15.1",
77104
"typescript": "~5.8.3",
78105
"vite": "^6.2.4"
79106
},
107+
"peerDependencies": {
108+
"react": "^19.1.0",
109+
"react-dom": "^19.1.0"
110+
},
111+
"packageManager": "pnpm@10.13.1",
80112
"ember": {
81113
"edition": "octane"
82114
},
83115
"ember-addon": {
84116
"version": 2,
85117
"type": "addon",
86118
"main": "addon-main.cjs"
87-
},
88-
"imports": {
89-
"#src/*": "./src/*",
90-
"#react/*": "./tests/react/*"
91-
},
92-
"exports": {
93-
".": {
94-
"types": "./declarations/index.d.ts",
95-
"default": "./dist/index.js"
96-
},
97-
"./*.css": "./dist/*.css",
98-
"./*": {
99-
"types": "./declarations/*.d.ts",
100-
"default": "./dist/*.js"
101-
},
102-
"./addon-main.js": "./addon-main.cjs"
103-
},
104-
"typesVersions": {
105-
"*": {
106-
"*": [
107-
"declarations/*"
108-
]
109-
}
110-
},
111-
"packageManager": "pnpm@10.13.1",
112-
"peerDependencies": {
113-
"react": "^19.1.0",
114-
"react-dom": "^19.1.0"
115119
}
116120
}

0 commit comments

Comments
 (0)