File tree 2 files changed +16
-9
lines changed
2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish to npm
2
2
on :
3
- push :
4
- tags :
5
- - v[0-9].[0-9]+.[0-9]+
3
+ release :
4
+ types : [published]
6
5
jobs :
7
6
publish :
8
7
runs-on : ubuntu-latest
@@ -13,12 +12,14 @@ jobs:
13
12
node-version : 12
14
13
- name : Check tag version
15
14
run : |
15
+ TAG_NAME=${{ github.event.release.tag_name }}
16
16
VERSION=$(node -e 'console.info(require("./package.json").version)')
17
- if [ "refs/tags/ v${VERSION}" != $GITHUB_REF ]; then
18
- echo "Ref ${GITHUB_REF } not match"
17
+ if [ "v${VERSION}" != $TAG_NAME ]; then
18
+ echo "Ref ${TAG_NAME } not match with v${VERSION} "
19
19
exit 1
20
20
fi
21
21
- run : npm install
22
- - run : npm publish
23
- env :
24
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
22
+ - name : publish
23
+ run : |
24
+ echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
25
+ npm publish
Original file line number Diff line number Diff line change 1
1
name : Run tests
2
- on : [push, pull_request]
2
+ on :
3
+ push :
4
+ branches :
5
+ - ' *'
6
+ pull_request :
7
+ branches :
8
+ - ' *'
3
9
jobs :
4
10
test :
5
11
runs-on : ubuntu-latest
You can’t perform that action at this time.
0 commit comments