Skip to content

Commit 0eadf68

Browse files
committed
Automate publishing to npm
1 parent f99fb2e commit 0eadf68

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/release.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish new release
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.event.release.target_commitish }}
15+
- name: Use Node.js 12
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 12
19+
registry-url: https://registry.npmjs.org/
20+
- run: npm ci
21+
- run: git config --global user.name "GitHub CD bot"
22+
- run: git config --global user.email "[email protected]"
23+
- run: npm version ${{ github.event.release.tag_name }}
24+
- run: npm run build
25+
# - run: npm test
26+
- run: npm publish
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
- run: git push
30+
env:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)