Skip to content

Commit

Permalink
🚀 chore(workflow): update publish.yml to configure npmrc before publi…
Browse files Browse the repository at this point in the history
…shing packages on GitHub and NPM
  • Loading branch information
Thre4dripper committed Dec 29, 2024
1 parent a9f1c60 commit 8461c39
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,19 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Publish package on NPM
run: npm publish
run: |
echo "Publishing to NPM"
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish package on GitHub
run: npm publish --registry=https://npm.pkg.github.com
- name: Publish to Github Packages
run: |
echo "Configuring for Github Packages"
jq '.name = "@thre4dripper/'${{ env.REPO_NAME }}'" package.json > package.json.tmp && mv package.json.tmp package.json
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
npm publish --registry=https://npm.pkg.github.com --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down

0 comments on commit 8461c39

Please sign in to comment.