@@ -69,19 +69,19 @@ jobs:
69
69
- name : 📦 Install Dependencies
70
70
run : bun install --frozen-lockfile
71
71
72
+ - name : 🔨 Build Package
73
+ run : |
74
+ echo "Building package for production..."
75
+ bun run build
76
+ echo "✅ Build completed successfully"
77
+
72
78
- name : 🧪 Run Full Test Suite
73
79
run : |
74
80
echo "Running comprehensive test suite before publish..."
75
81
bun test:unit
76
82
bun test:e2e
77
83
echo "✅ All tests passed"
78
84
79
- - name : 🔨 Build Package
80
- run : |
81
- echo "Building package for production..."
82
- bun run build
83
- echo "✅ Build completed successfully"
84
-
85
85
- name : 📋 Validate Build Output
86
86
run : |
87
87
echo "Validating build artifacts..."
@@ -167,12 +167,6 @@ jobs:
167
167
with :
168
168
bun-version : latest
169
169
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
-
176
170
- name : 📦 Install Dependencies
177
171
run : bun install --frozen-lockfile
178
172
@@ -181,27 +175,41 @@ jobs:
181
175
182
176
- name : 📝 Update Package Version
183
177
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
+ "
186
186
187
187
- name : 🔍 Pre-publish Dry Run
188
188
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
191
194
echo "✅ Dry run completed successfully"
195
+ env :
196
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
192
197
193
198
- name : 📤 Publish to npm
194
199
run : |
195
200
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
197
204
echo "✅ Successfully published to npm"
198
205
env :
199
206
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
200
207
201
208
- name : 🏷️ Tag Latest Version
202
209
if : needs.pre-checks.outputs.tag == 'latest'
203
210
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
205
213
echo "✅ Tagged as latest on npm"
206
214
env :
207
215
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments