@@ -215,74 +215,11 @@ jobs:
215
215
env :
216
216
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
217
217
218
- # Job 3: Publish to GitHub Packages
219
- publish-github :
220
- name : 📦 Publish to GitHub Packages
221
- runs-on : ubuntu-latest
222
- needs : [pre-checks, publish-npm]
223
- if : github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run
224
-
225
- permissions :
226
- contents : read
227
- packages : write
228
-
229
- environment :
230
- name : github-packages
231
- url : https://github.com/codev911/elysia-http-exception/packages
232
-
233
- steps :
234
- - name : 📥 Checkout Repository
235
- uses : actions/checkout@v4
236
-
237
- - name : 🟢 Setup Bun
238
- uses : oven-sh/setup-bun@v1
239
- with :
240
- bun-version : latest
241
-
242
- - name : 🔧 Setup Node.js for GitHub Packages
243
- uses : actions/setup-node@v4
244
- with :
245
- node-version : ' 18'
246
- registry-url : ' https://npm.pkg.github.com'
247
- scope : ' @codev911'
248
-
249
- - name : 📦 Install Dependencies
250
- run : bun install --frozen-lockfile
251
-
252
- - name : 🔨 Build Package
253
- run : bun run build
254
-
255
- - name : 📝 Update Package for GitHub Packages
256
- run : |
257
- # Update package.json for GitHub Packages
258
- npm version --no-git-tag-version ${{ needs.pre-checks.outputs.version }}
259
-
260
- # Update name for GitHub packages
261
- node -e "
262
- const pkg = require('./package.json');
263
- pkg.name = '@codev911/elysia-http-exception';
264
- pkg.publishConfig = {
265
- registry: 'https://npm.pkg.github.com',
266
- access: 'public'
267
- };
268
- require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2));
269
- "
270
-
271
- echo "✅ Package configured for GitHub Packages"
272
-
273
- - name : 📤 Publish to GitHub Packages
274
- run : |
275
- echo "Publishing to GitHub Packages..."
276
- npm publish --tag ${{ needs.pre-checks.outputs.tag }}
277
- echo "✅ Successfully published to GitHub Packages"
278
- env :
279
- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
280
-
281
- # Job 4: Post-publish Tasks
218
+ # Job 3: Post-publish Tasks
282
219
post-publish :
283
220
name : 📋 Post-publish Tasks
284
221
runs-on : ubuntu-latest
285
- needs : [pre-checks, publish-npm, publish-github ]
222
+ needs : [pre-checks, publish-npm]
286
223
if : always() && github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run
287
224
288
225
steps :
@@ -301,36 +238,22 @@ jobs:
301
238
echo "❌ **npm Registry**: Failed to publish" >> $GITHUB_STEP_SUMMARY
302
239
fi
303
240
304
- if [[ "${{ needs.publish-github.result }}" == "success" ]]; then
305
- echo "✅ **GitHub Packages**: Successfully published" >> $GITHUB_STEP_SUMMARY
306
- echo " - 🔗 [View on GitHub](https://github.com/codev911/elysia-http-exception/packages)" >> $GITHUB_STEP_SUMMARY
307
- else
308
- echo "❌ **GitHub Packages**: Failed to publish" >> $GITHUB_STEP_SUMMARY
309
- fi
310
-
311
241
echo "" >> $GITHUB_STEP_SUMMARY
312
242
echo "### 🛠️ Installation Command:" >> $GITHUB_STEP_SUMMARY
313
243
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
314
244
echo "bun add elysia-http-exception@${{ needs.pre-checks.outputs.version }}" >> $GITHUB_STEP_SUMMARY
315
245
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
316
246
317
247
- name : 🎉 Success Notification
318
- if : needs.publish-npm.result == 'success' && needs.publish-github.result == 'success'
248
+ if : needs.publish-npm.result == 'success'
319
249
run : |
320
- echo "🎉 Successfully published elysia-http-exception v${{ needs.pre-checks.outputs.version }} to both npm and GitHub Packages !"
250
+ echo "🎉 Successfully published elysia-http-exception v${{ needs.pre-checks.outputs.version }} to npm!"
321
251
echo "📦 npm: https://www.npmjs.com/package/elysia-http-exception/v/${{ needs.pre-checks.outputs.version }}"
322
- echo "📦 GitHub: https://github.com/codev911/elysia-http-exception/packages"
323
-
324
- - name : ⚠️ Partial Success Warning
325
- if : (needs.publish-npm.result == 'success') != (needs.publish-github.result == 'success')
326
- run : |
327
- echo "⚠️ Partial publish success - some registries failed"
328
- echo "Please check the individual job results and consider manual intervention if needed."
329
252
330
253
- name : ❌ Publish Failed
331
- if : needs.publish-npm.result != 'success' && needs.publish-github.result != 'success'
254
+ if : needs.publish-npm.result != 'success'
332
255
run : |
333
- echo "❌ Publish failed for both registries "
256
+ echo "❌ npm publish failed "
334
257
echo "Please check the logs and retry the publish process."
335
258
exit 1
336
259
0 commit comments