1
1
name : 📦 Build & Publish
2
2
3
3
on :
4
- push :
5
- tags :
6
- - ' v*.*.*'
7
4
release :
8
5
types : [published]
9
6
workflow_dispatch :
@@ -222,7 +219,7 @@ jobs:
222
219
publish-github :
223
220
name : 📦 Publish to GitHub Packages
224
221
runs-on : ubuntu-latest
225
- needs : pre-checks
222
+ needs : [ pre-checks, publish-npm]
226
223
if : github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run
227
224
228
225
permissions :
@@ -281,81 +278,11 @@ jobs:
281
278
env :
282
279
NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
283
280
284
- # Job 4: Create GitHub Release
285
- github-release :
286
- name : 🚀 Create GitHub Release
287
- runs-on : ubuntu-latest
288
- needs : [pre-checks, publish-npm]
289
- if : github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run && github.event_name != 'release'
290
-
291
- permissions :
292
- contents : write
293
-
294
- steps :
295
- - name : 📥 Checkout Repository
296
- uses : actions/checkout@v4
297
- with :
298
- fetch-depth : 0
299
-
300
- - name : 📋 Generate Release Notes
301
- id : changelog
302
- run : |
303
- VERSION="${{ needs.pre-checks.outputs.version }}"
304
-
305
- # Get the latest tag
306
- LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
307
-
308
- if [[ -n "$LATEST_TAG" ]]; then
309
- echo "Generating changelog from $LATEST_TAG to HEAD"
310
- CHANGELOG=$(git log $LATEST_TAG..HEAD --pretty=format:"- %s (%h)" --no-merges)
311
- else
312
- echo "No previous tags found, generating changelog from first commit"
313
- CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
314
- fi
315
-
316
- # Create release notes
317
- cat > release_notes.md << EOF
318
- ## 🚀 What's New in v$VERSION
319
-
320
- ### 📋 Changes
321
- $CHANGELOG
322
-
323
- ### 📦 Installation
324
- \`\`\`bash
325
- # Using bun (recommended)
326
- bun add elysia-http-exception@$VERSION
327
-
328
- # Using npm
329
- npm install elysia-http-exception@$VERSION
330
- \`\`\`
331
-
332
- ### 📚 Documentation
333
- - [README](https://github.com/codev911/elysia-http-exception#readme)
334
- - [Examples](https://github.com/codev911/elysia-http-exception/tree/main/example)
335
- - [npm Package](https://www.npmjs.com/package/elysia-http-exception)
336
-
337
- ### 🙏 Contributors
338
- Thank you to all contributors who made this release possible!
339
- EOF
340
-
341
- echo "release_notes_file=release_notes.md" >> $GITHUB_OUTPUT
342
-
343
- - name : 🚀 Create Release
344
- uses : actions/create-release@v1
345
- env :
346
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
347
- with :
348
- tag_name : v${{ needs.pre-checks.outputs.version }}
349
- release_name : 🚀 Release v${{ needs.pre-checks.outputs.version }}
350
- body_path : ${{ steps.changelog.outputs.release_notes_file }}
351
- draft : false
352
- prerelease : ${{ needs.pre-checks.outputs.is-prerelease }}
353
-
354
- # Job 5: Post-publish Tasks
281
+ # Job 4: Post-publish Tasks
355
282
post-publish :
356
283
name : 📋 Post-publish Tasks
357
284
runs-on : ubuntu-latest
358
- needs : [pre-checks, publish-npm, publish-github, github-release ]
285
+ needs : [pre-checks, publish-npm, publish-github]
359
286
if : always() && github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run
360
287
361
288
steps :
@@ -381,13 +308,6 @@ jobs:
381
308
echo "❌ **GitHub Packages**: Failed to publish" >> $GITHUB_STEP_SUMMARY
382
309
fi
383
310
384
- if [[ "${{ needs.github-release.result }}" == "success" ]]; then
385
- echo "✅ **GitHub Release**: Successfully created" >> $GITHUB_STEP_SUMMARY
386
- echo " - 🔗 [View Release](https://github.com/codev911/elysia-http-exception/releases/tag/v${{ needs.pre-checks.outputs.version }})" >> $GITHUB_STEP_SUMMARY
387
- else
388
- echo "❌ **GitHub Release**: Failed to create" >> $GITHUB_STEP_SUMMARY
389
- fi
390
-
391
311
echo "" >> $GITHUB_STEP_SUMMARY
392
312
echo "### 🛠️ Installation Command:" >> $GITHUB_STEP_SUMMARY
393
313
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
0 commit comments