-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1003 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
42
43
name: npm-publish
on:
push:
branches: [ main ]
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
# Publish to NPM
- name: Checkout Repo
uses: actions/checkout@main
- name: Setup Node.js (NPM)
uses: actions/setup-node@master
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- name: Use cached node_modules
uses: actions/cache@master
with:
path: node_modules
key: nodeModules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
nodeModules-
- name: Install dependencies
run: yarn install --frozen-lockfile
env:
CI: true
- name: Update Publish Config
run: sed -i 's^registry-url^registry.npmjs.org^' package.json
- name: Publish to NPM
run: npm publish --access public
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}