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