File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 5
5
tags :
6
6
- v*
7
7
8
+ permissions :
9
+ contents : write # for checkout and tag
10
+ pull-requests : write # for comments
11
+ packages : write # for publish
12
+
8
13
jobs :
9
14
publish :
10
15
runs-on : ubuntu-latest
@@ -17,15 +22,33 @@ jobs:
17
22
node-version : 12
18
23
registry-url : https://registry.npmjs.org/
19
24
25
+ - name : Git Identity
26
+ run : |
27
+ git config --global user.name 'github-actions[bot]'
28
+ git config --global user.email 'github-actions[bot]@users.noreply.github.com'
29
+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
30
+ env :
31
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32
+
20
33
- name : Checkout and pull branch
21
- run : git checkout $GIT_BRANCH && git pull
34
+ run : git checkout "${GITHUB_REF:11}" && git pull
22
35
23
36
- name : Install Packages
24
37
run : yarn
25
38
39
+ - name : Authenticate with Registry
40
+ run : |
41
+ yarn logout
42
+ echo "registry=http://registry.npmjs.org/" >> .npmrc
43
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
44
+ npm whoami
45
+ env :
46
+ NPM_TOKEN : ${{ secrets.npm_token }}
47
+
26
48
- name : Publish package
27
49
run : npx lerna publish --yes
28
50
env :
29
51
GH_TOKEN : ${{ secrets.GITHUB_PAT }}
30
52
GITHUB_TOKEN : ${{ secrets.GITHUB_PAT }}
53
+ NPM_TOKEN : ${{ secrets.npm_token }}
31
54
NODE_AUTH_TOKEN : ${{secrets.npm_token}}
You can’t perform that action at this time.
0 commit comments