Skip to content

Commit 38be769

Browse files
authored
Create publish-v1.yml
1 parent 0a166c3 commit 38be769

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish-v1.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on: registry_package
4+
5+
jobs:
6+
publish:
7+
name: Publish to npm
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
ref: 'v1'
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '12.x'
20+
registry-url: 'https://registry.npmjs.org/'
21+
22+
- name: Edit package.json to remove custom registry config
23+
run: |
24+
node -p "const pkg = require('./package.json'); \
25+
delete pkg.publishConfig.registry; \
26+
JSON.stringify(pkg, null, 2)" > pkg.json && mv pkg.json package.json
27+
28+
- name: Publish package to npm registry
29+
run: npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)