Skip to content

v0.0.21

v0.0.21 #25

Workflow file for this run

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 }}