File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish to npmjs.com
2
+ on :
3
+ push :
4
+ tags :
5
+ - " v*.*.*"
6
+ env :
7
+ NPM_TOKEN : ${{secrets.GITLAB_NPM_TOKEN}}
8
+ jobs :
9
+ publish :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - name : Setup node
14
+ uses : actions/setup-node@v2
15
+ with :
16
+ node-version : 18.x
17
+ cache : ' npm'
18
+ - name : Publish
19
+ run : ./publish.sh ${GITHUB_REF#refs/*/}
Original file line number Diff line number Diff line change
1
+ //registry.npmjs.org/:_authToken = ${ NPM_TOKEN }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ [ -z ${1} ] && echo " Please input version" && exit 0
6
+ version=${1}
7
+ originName=" markdown-it-attrs"
8
+ scopedName=" @cnblogs\/markdown-it-attrs"
9
+
10
+ sed -i " s/\" name\" : \" ${originName} \" /\" name\" : \" ${scopedName} \" /" " package.json"
11
+
12
+ npm version --no-git-tag-version ${version}
13
+ npm publish --access public
14
+
15
+ sed -i " s/\" name\" : \" ${scopedName} \" /\" name\" : \" ${originName} \" /" " package.json"
You can’t perform that action at this time.
0 commit comments