-
Notifications
You must be signed in to change notification settings - Fork 27
41 lines (35 loc) · 988 Bytes
/
npm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
name: "NPM Publish"
on:
release:
types:
- published
workflow_dispatch:
jobs:
npm-publish:
name: "Publish package to NPM"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version: "14"
- name: Publish to npm
if: github.ref != 'refs/heads/dev' && github.ref != 'refs/heads/v2.x'
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm (dev branch)
if: github.ref == 'refs/heads/dev'
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_TOKEN }}
tag: "next"
- name: Publish to npm (v2.x branch)
if: github.ref == 'refs/heads/v2.x'
uses: JS-DevTools/[email protected]
with:
token: ${{ secrets.NPM_TOKEN }}
tag: "previous"