Skip to content

Commit

Permalink
Add CI releasing setup and update release-it setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kategengler committed Sep 12, 2023
1 parent ef771c7 commit cec7ff6
Show file tree
Hide file tree
Showing 5 changed files with 434 additions and 252 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push dist
name: Publish to branch

on:
push:
Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: wyvox/action@v1
- uses: kategengler/put-built-npm-package-contents-on-branch@v1.0.0
- uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0
with:
branch: dist
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout + Install node + Install deps with pnpm
uses: wyvox/action@v1

- name: auto-dist-tag
run: npx auto-dist-tag --write
working-directory: './addon/'

- name: publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
working-directory: './addon/'
4 changes: 3 additions & 1 deletion addon/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ pnpm install
* And last (but not least 😁) do your release.

```sh
npx release-it
cd addon && npx release-it
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.

CI will run on the pushed tag and deploy to npm.
9 changes: 6 additions & 3 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@ember/test-helpers": "^3.0.3",
"@embroider/addon-dev": "^3.0.0",
"@glimmer/component": "^1.1.2",
"@release-it-plugins/lerna-changelog": "^6.0.0",
"@rollup/plugin-babel": "^5.3.0",
"@tsconfig/ember": "^2.0.0",
"@types/qunit": "^2.19.4",
Expand All @@ -62,8 +63,7 @@
"expect-type": "^0.15.0",
"prettier": "^2.8.8",
"qunit": "^2.19.4",
"release-it": "^15.11.0",
"release-it-lerna-changelog": "^5.0.0",
"release-it": "^16.1.5",
"rollup": "^2.67.0",
"rollup-plugin-copy": "^3.4.0",
"typescript": "^4.9.5"
Expand Down Expand Up @@ -97,14 +97,17 @@
},
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"npm": {
"publish": false
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
Expand Down
Loading

0 comments on commit cec7ff6

Please sign in to comment.