Skip to content

Commit d989eac

Browse files
committed
v0.1.3
1 parent fc11d5d commit d989eac

File tree

2 files changed

+7
-84
lines changed

2 files changed

+7
-84
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -215,74 +215,11 @@ jobs:
215215
env:
216216
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
217217

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
282219
post-publish:
283220
name: 📋 Post-publish Tasks
284221
runs-on: ubuntu-latest
285-
needs: [pre-checks, publish-npm, publish-github]
222+
needs: [pre-checks, publish-npm]
286223
if: always() && github.repository == 'codev911/elysia-http-exception' && !inputs.dry_run
287224

288225
steps:
@@ -301,36 +238,22 @@ jobs:
301238
echo "❌ **npm Registry**: Failed to publish" >> $GITHUB_STEP_SUMMARY
302239
fi
303240
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-
311241
echo "" >> $GITHUB_STEP_SUMMARY
312242
echo "### 🛠️ Installation Command:" >> $GITHUB_STEP_SUMMARY
313243
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
314244
echo "bun add elysia-http-exception@${{ needs.pre-checks.outputs.version }}" >> $GITHUB_STEP_SUMMARY
315245
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
316246
317247
- name: 🎉 Success Notification
318-
if: needs.publish-npm.result == 'success' && needs.publish-github.result == 'success'
248+
if: needs.publish-npm.result == 'success'
319249
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!"
321251
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."
329252
330253
- name: ❌ Publish Failed
331-
if: needs.publish-npm.result != 'success' && needs.publish-github.result != 'success'
254+
if: needs.publish-npm.result != 'success'
332255
run: |
333-
echo "❌ Publish failed for both registries"
256+
echo "❌ npm publish failed"
334257
echo "Please check the logs and retry the publish process."
335258
exit 1
336259

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "elysia-http-exception",
33
"description": "Elysia plugin for handling HTTP 4xx and 5xx errors with structured exception classes and automatic error responses",
4-
"version": "0.1.2",
4+
"version": "0.1.3",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/codev911/elysia-http-exception"

0 commit comments

Comments
 (0)