File tree Expand file tree Collapse file tree 2 files changed +49
-5
lines changed Expand file tree Collapse file tree 2 files changed +49
-5
lines changed Original file line number Diff line number Diff line change 7
7
jobs :
8
8
publish :
9
9
if : " !github.event.release.prerelease"
10
- uses : ./.github/actions/deploy-npm
11
- rc_publish :
12
- if : " !github.event.release.prerelease"
13
- uses : ./.github/actions/deploy-npm
14
- with : ${{ github.event.release.tag_name }}
10
+ uses : ./.github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
1
+ name : CD workflow to NPM publish
2
+
3
+ on :
4
+ workflow_call :
5
+ inputs :
6
+ checkout_ref :
7
+ type : string
8
+ required : true
9
+ tag_name :
10
+ type : string
11
+ required : true
12
+ tag :
13
+ type : string
14
+ default : latest
15
+ required : false
16
+ secrets :
17
+ NPM_TOKEN :
18
+
19
+ jobs :
20
+ publish :
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - uses : actions/checkout@v2
24
+ with :
25
+ ref : ${{ inputs.checkout_ref }}
26
+ - uses : actions/setup-node@v1
27
+ with :
28
+ node-version : 14
29
+ - run : |
30
+ git config --global user.name "RNB Bot"
31
+ git config --global user.email "[email protected] "
32
+ npm --no-git-tag-version version ${{ inputs.tag_name }}
33
+ - name : Install dependencies
34
+ run : |
35
+ if [ -e yarn.lock ]; then
36
+ yarn install --frozen-lockfile
37
+ fi
38
+ - uses : JS-DevTools/npm-publish@v1
39
+ with :
40
+ token : ${{ secrets.NPM_TOKEN }}
41
+ tag : ${{ github.event.release.tag_name }}
42
+ - name : Commit and push
43
+ run : |
44
+ git add .
45
+ git commit -am "🏷️(version) Update boilerplate to version ${{ github.event.release.tag_name }}"
46
+ git push
47
+ env :
48
+ github-token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments