44 push :
55 branches :
66 - main
7- pull_request :
8- branches :
9- - main
107
118jobs :
129 versioning :
1310 runs-on : ubuntu-latest
11+ env :
12+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
1413 steps :
1514 # Checkout the code
1615 - name : Checkout code
17- uses : actions/checkout@v2
16+ uses : actions/checkout@v3
1817
1918 # Set up Node.js environment
2019 - name : Set up Node.js
2120 uses : actions/setup-node@v3
2221 with :
2322 node-version : ' 20'
23+ registry-url : ' https://registry.npmjs.org/'
2424
25- # Install dependencies
25+ # Install all dependencies (including devDependencies for lint/test/build)
2626 - name : Install dependencies
27- run : yarn install --frozen-lockfile --production
27+ run : yarn install
2828
2929 # Run linting
3030 - name : Run lint
@@ -38,21 +38,37 @@ jobs:
3838 - name : Build client
3939 run : yarn build-client
4040
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+
4151 # Semantic release step: Automatically determine the version and release
4252 - name : Semantic Release for versioning
4353 env :
4454 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4555 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
46- run : |
47- yarn release
56+ run : yarn release
4857
49- # Optionally, you can include a job to deploy to npm
5058 publish :
51- needs : release
59+ needs : versioning
5260 runs-on : ubuntu-latest
61+ env :
62+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
5363 steps :
64+ - name : Checkout code
65+ uses : actions/checkout@v3
66+
67+ - name : Install production dependencies
68+ run : yarn install --frozen-lockfile --production
69+
5470 # Publish to npm
5571 - name : Publish to npm
5672 run : yarn publish --non-interactive
5773 env :
58- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
74+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments