Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 181dc31

Browse files
committedSep 12, 2023
Add CI releasing setup and update release-it setup
1 parent e52e88b commit 181dc31

File tree

5 files changed

+404
-221
lines changed

5 files changed

+404
-221
lines changed
 

‎.github/workflows/push-dist.yml renamed to ‎.github/workflows/publish-to-branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push dist
1+
name: Publish to branch
22

33
on:
44
push:
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: wyvox/action@v1
15-
- uses: kategengler/put-built-npm-package-contents-on-branch@v1.0.0
15+
- uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0
1616
with:
1717
branch: dist
1818
token: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/publish.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
name: Publish to npm
11+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout + Install node + Install deps with pnpm
15+
uses: wyvox/action@v1
16+
17+
- name: auto-dist-tag
18+
run: npx auto-dist-tag --write
19+
working-directory: './addon/'
20+
21+
- name: publish to npm
22+
run: npm publish
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
25+
working-directory: './addon/'

‎addon/RELEASE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ pnpm install
5050
* And last (but not least 😁) do your release.
5151

5252
```sh
53-
npx release-it
53+
cd addon && npx release-it
5454
```
5555

5656
[release-it](https://github.com/release-it/release-it/) manages the actual
5757
release process. It will prompt you to to choose the version number after which
5858
you will have the chance to hand tweak the changelog to be used (for the
5959
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
6060
pushing the tag and commits, etc.
61+
62+
CI will run on the pushed tag and deploy to npm.

‎addon/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@ember/test-helpers": "^3.0.3",
4949
"@embroider/addon-dev": "^3.0.0",
5050
"@glimmer/component": "^1.1.2",
51+
"@release-it-plugins/lerna-changelog": "^6.0.0",
5152
"@rollup/plugin-babel": "^5.3.0",
5253
"@tsconfig/ember": "^2.0.0",
5354
"@types/qunit": "^2.19.4",
@@ -62,8 +63,7 @@
6263
"expect-type": "^0.15.0",
6364
"prettier": "^2.8.8",
6465
"qunit": "^2.19.4",
65-
"release-it": "^15.11.0",
66-
"release-it-lerna-changelog": "^5.0.0",
66+
"release-it": "^16.1.5",
6767
"rollup": "^2.67.0",
6868
"rollup-plugin-copy": "^3.4.0",
6969
"typescript": "^4.9.5"
@@ -97,14 +97,17 @@
9797
},
9898
"release-it": {
9999
"plugins": {
100-
"release-it-lerna-changelog": {
100+
"@release-it-plugins/lerna-changelog": {
101101
"infile": "CHANGELOG.md",
102102
"launchEditor": true
103103
}
104104
},
105105
"git": {
106106
"tagName": "v${version}"
107107
},
108+
"npm": {
109+
"publish": false
110+
},
108111
"github": {
109112
"release": true,
110113
"tokenRef": "GITHUB_AUTH"

‎pnpm-lock.yaml

+368-215
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.