4
4
push :
5
5
branches :
6
6
- main
7
- pull_request :
8
- branches :
9
- - main
10
7
11
8
jobs :
12
9
versioning :
13
10
runs-on : ubuntu-latest
11
+ env :
12
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
14
13
steps :
15
14
# Checkout the code
16
15
- name : Checkout code
17
- uses : actions/checkout@v2
16
+ uses : actions/checkout@v3
18
17
19
18
# Set up Node.js environment
20
19
- name : Set up Node.js
21
20
uses : actions/setup-node@v3
22
21
with :
23
22
node-version : ' 20'
23
+ registry-url : ' https://registry.npmjs.org/'
24
24
25
- # Install dependencies
25
+ # Install all dependencies (including devDependencies for lint/test/build)
26
26
- name : Install dependencies
27
- run : yarn install --frozen-lockfile --production
27
+ run : yarn install
28
28
29
29
# Run linting
30
30
- name : Run lint
@@ -38,21 +38,37 @@ jobs:
38
38
- name : Build client
39
39
run : yarn build-client
40
40
41
+ # Verify NPM_TOKEN
42
+ - name : Verify NPM_TOKEN
43
+ env :
44
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
45
+ run : |
46
+ echo "NPM_TOKEN: $NPM_TOKEN"
47
+ echo "secrets.NPM_TOKEN: ${{ secrets.NPM_TOKEN }}"
48
+
49
+ curl -H "Authorization: Bearer ${{ secrets.NPM_TOKEN }}" https://registry.npmjs.org/-/whoami
50
+
41
51
# Semantic release step: Automatically determine the version and release
42
52
- name : Semantic Release for versioning
43
53
env :
44
54
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45
55
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
46
- run : |
47
- yarn release
56
+ run : yarn release
48
57
49
- # Optionally, you can include a job to deploy to npm
50
58
publish :
51
- needs : release
59
+ needs : versioning
52
60
runs-on : ubuntu-latest
61
+ env :
62
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
53
63
steps :
64
+ - name : Checkout code
65
+ uses : actions/checkout@v3
66
+
67
+ - name : Install production dependencies
68
+ run : yarn install --frozen-lockfile --production
69
+
54
70
# Publish to npm
55
71
- name : Publish to npm
56
72
run : yarn publish --non-interactive
57
73
env :
58
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
74
+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments