2020-12-27 18:42:48 +01:00
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
|
|
|
|
|
|
name: 'Node.js Package'
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-npm:
|
|
|
|
runs-on: 'ubuntu-latest'
|
|
|
|
steps:
|
2021-05-12 16:41:03 +02:00
|
|
|
- uses: 'actions/checkout@v2.3.4'
|
2020-12-27 18:42:48 +01:00
|
|
|
|
2021-03-08 14:33:53 +01:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: 'actions/setup-node@v2.1.5'
|
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
registry-url: 'https://registry.npmjs.org/'
|
|
|
|
|
2020-12-27 18:42:48 +01:00
|
|
|
- name: 'Cache dependencies'
|
2021-04-14 14:10:26 +02:00
|
|
|
uses: 'actions/cache@v2.1.5'
|
2020-12-27 18:42:48 +01:00
|
|
|
with:
|
2021-03-08 14:33:53 +01:00
|
|
|
path: '.npm'
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
2020-12-27 18:42:48 +01:00
|
|
|
|
2021-03-08 14:33:53 +01:00
|
|
|
- name: 'Install dependencies'
|
|
|
|
run: 'npm ci --cache .npm --prefer-offline'
|
|
|
|
|
|
|
|
- name: 'Build'
|
|
|
|
run: 'npm run build'
|
2020-12-27 18:42:48 +01:00
|
|
|
|
2021-03-08 14:33:53 +01:00
|
|
|
- name: 'Publish package on npm'
|
|
|
|
run: 'npm publish --access public'
|
2020-12-27 18:42:48 +01:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|