Skip to content

0.4.1

0.4.1 #7

Workflow file for this run

name: NPM Pipeline
on:
workflow_call: {}
push:
branches:
- "*"
tags:
- "v*"
jobs:
Test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_INSTALL_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
Build:
runs-on: ubuntu-latest
needs: Test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_INSTALL_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
Publish:
runs-on: ubuntu-latest
needs: Build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "npm"
registry-url: https://registry.npmjs.org
cache-dependency-path: package-lock.json
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
- name: Publish package
run: npm publish