@@ -348,27 +348,42 @@ jobs:
348
348
echo "ℹ️ No README changes to stage"
349
349
fi
350
350
351
- - name : Setup npmrc for multiple registries
351
+ - name : Prepare GitHub Packages package.json
352
352
run : |
353
- echo "🔧 Setting up .npmrc for multiple registry publishing ..."
353
+ echo "📦 Preparing package configuration for GitHub Packages ..."
354
354
355
- # Configure for both NPM and GitHub Packages
356
- cat > .npmrc << EOF
357
- registry=https://registry.npmjs.org/
358
- //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
359
- //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
360
- @exadev:registry=https://npm.pkg.github.com
361
- EOF
355
+ # Create dist-github directory
356
+ mkdir -p dist-github
362
357
363
- echo "✅ Registry configuration completed"
358
+ # Create a scoped package.json for GitHub Packages
359
+ jq '.name = "@exadev/markmv" | .publishConfig.registry = "https://npm.pkg.github.com"' package.json > package-github.json
360
+
361
+ echo "✅ GitHub Packages configuration prepared"
364
362
365
363
- name : Release (includes README and badge updates)
366
364
env :
367
365
GITHUB_TOKEN : ${{ secrets.SEMANTIC_RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
368
366
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
369
367
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
368
+ # Environment variables for npm-multiple plugin
369
+ NPMJS_NPM_CONFIG_REGISTRY : https://registry.npmjs.org/
370
+ NPMJS_NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
371
+ GITHUB_NPM_CONFIG_REGISTRY : https://npm.pkg.github.com
372
+ GITHUB_NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
370
373
run : |
371
374
echo "🚀 Starting semantic-release with staged README and badge updates..."
375
+
376
+ # Set up .npmrc for both registries
377
+ cat > .npmrc << EOF
378
+ registry=https://registry.npmjs.org/
379
+ //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
380
+ //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
381
+ @exadev:registry=https://npm.pkg.github.com
382
+ EOF
383
+
384
+ # Copy the GitHub-scoped package.json to the directory
385
+ cp package-github.json dist-github/package.json
386
+
372
387
npm run release
373
388
echo "✅ Release completed - packages published to both NPM and GitHub Packages"
374
389
0 commit comments