Skip to content

Merge pull request #7 from nwaughachukwuma/refactor-and-optimize #38

Merge pull request #7 from nwaughachukwuma/refactor-and-optimize

Merge pull request #7 from nwaughachukwuma/refactor-and-optimize #38

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "index.ts"
- "README.md"
- ".github/workflows/publish.yml"
tags:
- "v*"
jobs:
publish:
name: test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version:
- 18
- 16
- 14
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
id: cache-deps
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm run build
- run: npm run tsc
- run: npm run test
- uses: heinrichreimer/github-changelog-generator-action@v2.3
if: matrix.node-version == 14
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: JS-DevTools/npm-publish@v1
if: matrix.node-version == 14
with:
token: ${{ secrets.NPM_TOKEN }}
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.node-version == 14
with:
generate_release_notes: true
files: |
./lib/**/*.ts