Skip to content

Commit

Permalink
Create publish-v1.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 authored Nov 14, 2023
1 parent 0a166c3 commit 38be769
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on: registry_package

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: 'v1'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org/'

- name: Edit package.json to remove custom registry config
run: |
node -p "const pkg = require('./package.json'); \
delete pkg.publishConfig.registry; \
JSON.stringify(pkg, null, 2)" > pkg.json && mv pkg.json package.json
- name: Publish package to npm registry
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 38be769

Please sign in to comment.