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 }}
13+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1414 steps :
1515 # Checkout the code
1616 - name : Checkout code
17- uses : actions/checkout@v2
17+ uses : actions/checkout@v3
1818
1919 # Set up Node.js environment
2020 - name : Set up Node.js
2121 uses : actions/setup-node@v3
2222 with :
2323 node-version : ' 20'
24+ registry-url : ' https://registry.npmjs.org/'
2425
25- # Install dependencies
26+ # Install all dependencies (including devDependencies for lint/test/build)
2627 - name : Install dependencies
27- run : yarn install --frozen-lockfile --production
28+ run : yarn install
2829
2930 # Run linting
3031 - name : Run lint
@@ -38,21 +39,26 @@ jobs:
3839 - name : Build client
3940 run : yarn build-client
4041
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+
4148 # Semantic release step: Automatically determine the version and release
4249 - name : Semantic Release for versioning
43- env :
44- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
46- run : |
47- yarn release
50+ run : yarn release --debug
4851
49- # Optionally, you can include a job to deploy to npm
5052 publish :
51- needs : release
53+ needs : versioning
5254 runs-on : ubuntu-latest
5355 steps :
56+ - name : Checkout code
57+ uses : actions/checkout@v3
58+
59+ - name : Install production dependencies
60+ run : yarn install --frozen-lockfile --production
61+
5462 # Publish to npm
5563 - name : Publish to npm
5664 run : yarn publish --non-interactive
57- env :
58- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments