Skip to content

Add NPM publish step to CI #23

Add NPM publish step to CI

Add NPM publish step to CI #23

Workflow file for this run

name: is.js CICD
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
node-version: [14, 16, 18, 20]
name: is.js - nodeJS v${{ matrix.node-version }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Init - node v${{ matrix.node-version }}
run: yarn --frozen-lockfile --non-interactive
- name: Lint - node v${{ matrix.node-version }}
run: yarn lint
- name: Test - node v${{ matrix.node-version }}
run: yarn test
- name: Package - node v${{ matrix.node-version }}
run: yarn build
- name: Validation - node v${{ matrix.node-version }}
run: npm install kj4ezj-is-*.tgz
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: kj4ezj-is-${{ matrix.node-version }}
path: kj4ezj-is-*.tgz
- name: Publish to NPM
run: npm publish --provenance --access public
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}