-
Notifications
You must be signed in to change notification settings - Fork 9
31 lines (28 loc) · 967 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
# This workflow will build and then publish the package to NPM when a release is created
name: NPM Publish
on:
push:
branches:
- master
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- run: sudo git config --global --add safe.directory '*'
- run: sudo git config --system --add safe.directory '*'
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 12.18.0 # LTS
- run: yarn install --frozen-lockfile
- run: yarn build
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@4f4bf159e299f65d21cd1cbd96fc5d53228036df
with:
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # in repo settings