@@ -21,6 +21,8 @@ concurrency:
2121 group : ' publish'
2222 cancel-in-progress : true
2323
24+ # cspell:ignore userconfig
25+
2426jobs :
2527 build :
2628 if : ${{ github.event.workflow_run.conclusion == 'success' }}
6163 run : mkdocs build
6264
6365 # Remove build artifacts
64- - name : Clean build directory
65- run : rm -rf build/
66+ # - name: Clean build directory
67+ # run: rm -rf build/
6668
6769 # Create Git archive of version-controlled files
6870 - name : Create clean source archive
9799 node-version : 24
98100 registry-url : https://registry.npmjs.org/
99101 cache : npm
102+ cache-dependency-path : package-lock.json
100103
101104 - name : Upgrade npm
102105 run : |
@@ -106,16 +109,32 @@ jobs:
106109 - name : Install Node.js dependencies
107110 run : npm ci
108111
109- - name : Verify npm authentication
110- run : npm whoami
111- env :
112- NODE_AUTH_TOKEN : ${{ secrets.NPM_NETPRO }}
113-
114112 - name : Set up Git user
115113 run : |
116114 git config --global user.email "[email protected] " 117115 git config --global user.name "SunDevil311"
118116
117+ - name : Print npm config and registry info
118+ run : |
119+ echo "🔍 NPM registry (from config):"
120+ npm config get registry
121+
122+ echo "🔍 NPM user config location:"
123+ echo "$NPM_CONFIG_USERCONFIG"
124+
125+ echo "🔍 .npmrc contents:"
126+ cat "$NPM_CONFIG_USERCONFIG" || echo "❌ No .npmrc found"
127+
128+ echo "🔐 Token prefix:"
129+ echo "${NODE_AUTH_TOKEN:0:4}********"
130+ env :
131+ NODE_AUTH_TOKEN : ${{ secrets.NPM_NETPRO }}
132+
133+ - name : Verify npm authentication
134+ run : npm whoami
135+ env :
136+ NODE_AUTH_TOKEN : ${{ secrets.NPM_NETPRO }}
137+
119138 - name : Publish package to npmjs
120139 run : npm publish --access public
121140 env :
@@ -144,6 +163,7 @@ jobs:
144163 node-version : 24
145164 registry-url : https://npm.pkg.github.com/
146165 cache : npm
166+ cache-dependency-path : package-lock.json
147167
148168 - name : Upgrade npm
149169 run : |
@@ -153,11 +173,6 @@ jobs:
153173 - name : Install Node.js dependencies
154174 run : npm ci
155175
156- - name : Verify npm authentication
157- run : npm whoami
158- env :
159- NODE_AUTH_TOKEN : ${{ secrets.NWPRO_GPR }}
160-
161176 - name : Set up Git user
162177 run : |
163178 git config --global user.email "[email protected] " @@ -167,6 +182,27 @@ jobs:
167182 run : |
168183 sed -i 's/"name": ".*"/"name": "@netwk-pro\/blog"/' package.json
169184
185+ - name : Print npm config and registry info
186+ run : |
187+ echo "🔍 NPM registry (from config):"
188+ npm config get registry
189+
190+ echo "🔍 NPM user config location:"
191+ echo "$NPM_CONFIG_USERCONFIG"
192+
193+ echo "🔍 .npmrc contents:"
194+ cat "$NPM_CONFIG_USERCONFIG" || echo "❌ No .npmrc found"
195+
196+ echo "🔐 Token prefix:"
197+ echo "${NODE_AUTH_TOKEN:0:4}********"
198+ env :
199+ NODE_AUTH_TOKEN : ${{ secrets.NWPRO_GPR }}
200+
201+ - name : Verify npm authentication
202+ run : npm whoami
203+ env :
204+ NODE_AUTH_TOKEN : ${{ secrets.NWPRO_GPR }}
205+
170206 - name : Publish package to GPR
171207 run : npm publish
172208 env :
0 commit comments