-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.17 KB
/
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
name: NPM Release
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}
- name: Validate and extract release information
id: release
uses: manovotny/github-releases-for-automated-package-publishing-action@v2.0.1
- name: Set node version
uses: actions/setup-node@v3
with:
always-auth: true
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: yarn
- run: yarn build
- name: Publish version
if: steps.release.outputs.tag == ''
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- name: Publish tagged version
if: steps.release.outputs.tag != ''
run: npm publish --tag ${{ steps.release.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}