Skip to content

Commit 4a17ad4

Browse files
committed
Add release GitHub Actions workflow
1 parent e8c4183 commit 4a17ad4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)