File tree Expand file tree Collapse file tree 3 files changed +63
-35
lines changed Expand file tree Collapse file tree 3 files changed +63
-35
lines changed Original file line number Diff line number Diff line change
1
+ name : Lint
2
+ on : [push, pull_request]
3
+
4
+ jobs :
5
+ test :
6
+ runs-on : ubuntu-latest
7
+ steps :
8
+ - uses : actions/checkout@v1
9
+
10
+ - name : Use Node.js
11
+ uses : actions/setup-node@v1
12
+ with :
13
+ node-version : ' 12'
14
+
15
+ - name : Run linter
16
+ run : |
17
+ npm install
18
+ npm run lint
Original file line number Diff line number Diff line change
1
+ name : Deploy to NPM
2
+ on :
3
+ release :
4
+ types : [published]
5
+
6
+ jobs :
7
+ test :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v1
11
+
12
+ - name : Use Node.js
13
+ uses : actions/setup-node@v1
14
+ with :
15
+ node-version : ' 12'
16
+
17
+ - name : Install packages
18
+ if : success() && startsWith(github.ref, 'refs/tags/v')
19
+ run : |
20
+ npm install
21
+
22
+ - name : Build and deploy
23
+ if : success() && startsWith(github.ref, 'refs/tags/v')
24
+ env :
25
+ GITHUB_REF_TAG : ${{ github.ref }}
26
+ NPMJS_REGISTRY : registry.npmjs.org
27
+ NPMJS_TOKEN : ${{ secrets.NPM_TOKEN }}
28
+ run : |
29
+ echo "Extracting version from GITHUB_REF_TAG: $GITHUB_REF_TAG"
30
+ export VERSION=$(echo "$GITHUB_REF_TAG" | sed -e "s#^refs/tags/##")
31
+ echo "Version is $VERSION"
32
+ npm version --no-git-tag-version "${VERSION}"
33
+ npm run build
34
+ echo "//${NPMJS_REGISTRY}/:_authToken=${NPMJS_TOKEN}" > .npmrc
35
+ [ $(echo "${VERSION}" | grep rc) ] && echo "publishing with next tag to npm - ${VERSION}" || echo "publishing with latest tag to npm - ${VERSION}"
36
+ [ $(echo "${VERSION}" | grep rc) ] && npm publish --access public --tag next || npm publish --access public
37
+ echo "Published to npm registry: ${NPMJS_REGISTRY}"
38
+ tar -cvzf /tmp/dist.tar.gz dist/
39
+
40
+ - name : Create artifacts
41
+ if : success() && startsWith(github.ref, 'refs/tags/v')
42
+ uses : actions/upload-artifact@master
43
+ with :
44
+ name : dist.tar.gz
45
+ path : /tmp/dist.tar.gz
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments