@@ -69,19 +69,19 @@ jobs:
6969 - name : 📦 Install Dependencies
7070 run : bun install --frozen-lockfile
7171
72+ - name : 🔨 Build Package
73+ run : |
74+ echo "Building package for production..."
75+ bun run build
76+ echo "✅ Build completed successfully"
77+
7278 - name : 🧪 Run Full Test Suite
7379 run : |
7480 echo "Running comprehensive test suite before publish..."
7581 bun test:unit
7682 bun test:e2e
7783 echo "✅ All tests passed"
7884
79- - name : 🔨 Build Package
80- run : |
81- echo "Building package for production..."
82- bun run build
83- echo "✅ Build completed successfully"
84-
8585 - name : 📋 Validate Build Output
8686 run : |
8787 echo "Validating build artifacts..."
@@ -167,12 +167,6 @@ jobs:
167167 with :
168168 bun-version : latest
169169
170- - name : 🔧 Setup Node.js for npm
171- uses : actions/setup-node@v4
172- with :
173- node-version : ' 18'
174- registry-url : ' https://registry.npmjs.org'
175-
176170 - name : 📦 Install Dependencies
177171 run : bun install --frozen-lockfile
178172
@@ -181,27 +175,41 @@ jobs:
181175
182176 - name : 📝 Update Package Version
183177 run : |
184- npm version --no-git-tag-version ${{ needs.pre-checks.outputs.version }}
185- echo "✅ Package version updated to ${{ needs.pre-checks.outputs.version }}"
178+ # Update package.json version using Node
179+ node -e "
180+ const fs = require('fs');
181+ const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
182+ pkg.version = '${{ needs.pre-checks.outputs.version }}';
183+ fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
184+ console.log('✅ Package version updated to ${{ needs.pre-checks.outputs.version }}');
185+ "
186186
187187 - name : 🔍 Pre-publish Dry Run
188188 run : |
189- echo "Running npm publish dry run..."
190- npm publish --dry-run --tag ${{ needs.pre-checks.outputs.tag }}
189+ echo "Running publish dry run..."
190+ # Create .npmrc for authentication
191+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
192+ # Use bun to create tarball
193+ bun pack
191194 echo "✅ Dry run completed successfully"
195+ env :
196+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
192197
193198 - name : 📤 Publish to npm
194199 run : |
195200 echo "Publishing to npm registry..."
196- npm publish --tag ${{ needs.pre-checks.outputs.tag }} --access public
201+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
202+ # Use npx for publishing since bun publish is experimental
203+ npx npm@latest publish --tag ${{ needs.pre-checks.outputs.tag }} --access public
197204 echo "✅ Successfully published to npm"
198205 env :
199206 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
200207
201208 - name : 🏷️ Tag Latest Version
202209 if : needs.pre-checks.outputs.tag == 'latest'
203210 run : |
204- npm dist-tag add elysia-http-exception@${{ needs.pre-checks.outputs.version }} latest
211+ echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
212+ npx npm@latest dist-tag add elysia-http-exception@${{ needs.pre-checks.outputs.version }} latest
205213 echo "✅ Tagged as latest on npm"
206214 env :
207215 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments