-
Notifications
You must be signed in to change notification settings - Fork 11
46 lines (44 loc) · 1.3 KB
/
on-release.yaml
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
44
45
46
name: Node.js Publish
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- '@streamparser/json'
- '@streamparser/json-node'
- '@streamparser/json-whatwg'
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
# Needs to be explicitly specified for auth to work
registry-url: 'https://registry.npmjs.org'
- name: Cache Node.js modules on Linux
uses: actions/cache@v3
if: ${{ runner.OS != 'Windows' }}
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Cache Node.js modules on Windows
uses: actions/cache@v3
if: ${{ runner.OS == 'Windows' }}
with:
path: ~\AppData\Roaming\npm-cache
key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci
- run: npm run build
- run: npm publish --access public -w ${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}