Skip to content

Commit 0790507

Browse files
authored
Merge pull request #924 from embermap/setup-release-plan
Setup release-plan
2 parents 4a713a5 + f69be63 commit 0790507

File tree

5 files changed

+967
-37
lines changed

5 files changed

+967
-37
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,38 @@
1-
name: Release to npm
1+
# For every push to the primary branch with .release-plan.json modified,
2+
# runs release-plan.
3+
4+
name: Publish Stable
25

36
on:
4-
release:
5-
types: [created]
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
618

719
jobs:
820
publish:
9-
name: "Release"
21+
name: "NPM Publish"
1022
runs-on: ubuntu-latest
23+
permissions:
24+
contents: write
25+
id-token: write
26+
attestations: write
1127

1228
steps:
13-
- uses: actions/checkout@v2
14-
- name: Install Node
15-
uses: actions/setup-node@v2
29+
- uses: actions/checkout@v5
30+
- uses: actions/setup-node@v6
1631
with:
17-
node-version: 18.x
18-
cache: yarn
19-
- name: Install Dependencies
20-
run: yarn install --frozen-lockfile
21-
- run: npm publish
32+
node-version: 22
33+
registry-url: 'https://registry.npmjs.org'
34+
- run: npm ci
35+
- name: Publish to NPM
36+
run: npx release-plan publish --provenance
2237
env:
23-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
38+
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: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1-
This addon is setup to publish to npm when GitHub release gets created, see [publish](./.github/workflows/publish.yml)
2-
GitHub workflow.
1+
# Release Process
32

4-
Hence, sequence of steps should be:
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.
54

6-
- `GITHUB_AUTH=abc npx lerna-changelog` to create changelog
7-
- `npm version [major | minor | patch]` to tag the release
8-
- `git push` to push code changes
9-
- `git push origin tag <tag_name>` to push the git tag
10-
- Create new GitHub release from newly published tag https://github.com/embermap/ember-cli-fastboot-testing/releases/new
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/embermap/ember-cli-fastboot-testing/pulls?q=is%3Apr+is%3Aopen+%22Prepare+Release%22+in%3Atitle) PR

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"prettier": "^3.3.3",
9494
"qunit": "^2.22.0",
9595
"qunit-dom": "^3.2.1",
96+
"release-plan": "^0.17.2",
9697
"semver": "^7.6.3",
9798
"stylelint": "^15.11.0",
9899
"stylelint-config-standard": "^34.0.0",
@@ -106,6 +107,10 @@
106107
"engines": {
107108
"node": "18.* || 20.* || >= 22"
108109
},
110+
"volta": {
111+
"node": "18.20.4",
112+
"yarn": "1.22.22"
113+
},
109114
"ember": {
110115
"edition": "octane"
111116
},
@@ -118,8 +123,5 @@
118123
},
119124
"fastbootDependencies": [
120125
"crypto"
121-
],
122-
"volta": {
123-
"node": "18.20.4"
124-
}
126+
]
125127
}

0 commit comments

Comments
 (0)