@@ -16,22 +16,13 @@ jobs:
16
16
uses : ./.github/actions/setup
17
17
with :
18
18
node_version : ' 12'
19
- registry_url : https://registry.npmjs.org
20
- - name : Check version
21
- id : version
22
- run : |
23
- echo "::set-output name=name::$(jq -r '.name' package.json)"
24
- echo "::set-output name=current::$(jq -r '.version' package.json)"
25
- echo "::set-output name=published::$(npm view $(jq -r '.name' package.json)@$(jq -r '.version' package.json) version)"
26
- env :
27
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
28
19
- name : Build
29
20
run : npn run build
30
- - name : Publish ${{ steps.version.outputs.name }}@${{ steps.version.outputs.current }}
31
- if : ${{ endsWith(github.ref, format('v{0}', steps.version.outputs.published)) == false }}
32
- run : npm publish --access public
33
- env :
34
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
21
+ - name : Publish
22
+ uses : JS-DevTools/npm-publish@v1
23
+ with :
24
+ access : public
25
+ token : ${{ secrets.NPM_TOKEN }}
35
26
github :
36
27
runs-on : ubuntu-20.04
37
28
steps :
@@ -41,19 +32,11 @@ jobs:
41
32
uses : ./.github/actions/setup
42
33
with :
43
34
node_version : ' 12'
44
- registry_url : https://npm.pkg.github.com
45
- - name : Check version
46
- id : version
47
- run : |
48
- echo "::set-output name=name::$(jq -r '.name' package.json)"
49
- echo "::set-output name=current::$(jq -r '.version' package.json)"
50
- echo "::set-output name=published::$(npm view $(jq -r '.name' package.json)@$(jq -r '.version' package.json) version)"
51
- env :
52
- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
35
- name : Build
54
36
run : npm run build
55
- - name : Publish ${{ steps.version.outputs.name }}@${{ steps.version.outputs.current }}
56
- if : ${{ endsWith(github.ref, format('v{0}', steps.version.outputs.published)) == false }}
57
- run : npm publish --access public
58
- env :
59
- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37
+ - name : Publish
38
+ uses : JS-DevTools/npm-publish@v1
39
+ with :
40
+ access : public
41
+ token : ${{ secrets.GITHUB_TOKEN }}
42
+ registry : https://npm.pkg.github.com
0 commit comments