Update publish.yml

This commit is contained in:
Adam Matthiesen 2024-01-16 01:03:15 -08:00 committed by GitHub
parent 8ea980e96b
commit e16b1c932c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 2 deletions

View File

@ -5,7 +5,7 @@ on:
types: [created]
jobs:
publish:
publishnpm:
runs-on: ubuntu-latest
steps:
- name: checkout
@ -16,6 +16,32 @@ jobs:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: publish-npm
run: npm publish --access public
run: |
# Change publish registry
echo "$(jq '.publishConfig.registry = "https://registry.npmjs.org"' package.json)" > package.json
# Publish package
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
githubpackage:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: publish-github
run: |
# Change publish registry
echo "$(jq '.publishConfig.registry = "https://npm.pkg.github.com"' package.json)" > package.json
# Publish package
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}