Skip to content

Commit eed3fb2

Browse files
committed
feat: add github publish and release action
1 parent 92f5423 commit eed3fb2

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
on:
2+
push:
3+
tags:
4+
- "v*"
5+
name: Publish
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: "20.x"
14+
registry-url: https://registry.npmjs.org/
15+
- run: npm i
16+
- run: npm publish
17+
env:
18+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
19+
github-release:
20+
needs: publish
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: "20.x"
27+
registry-url: https://registry.npmjs.org/
28+
- run: npm i -g github-release-from-changelog
29+
- run: github-release-from-changelog
30+
env:
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"scripts": {
88
"watch": "tsc --watch",
99
"build": "tsc",
10-
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
10+
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
11+
"postversion": "git push --follow-tags",
12+
"prepublishOnly": "npm run test && npm run build"
1113
},
1214
"repository": {
1315
"type": "git",

0 commit comments

Comments
 (0)