kamiazya/typedoc-plugin-nomnoml

View on GitHub
.github/workflows/nodejs.yml

Summary

Maintainability
Test Coverage
name: Node CI

on: [push]

jobs:
  tests:
    name: Test on node ${{ matrix.node-version }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node-version: [12.x, 14.x, 16.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ubuntu-latest
    - name: Install dependencies
      run: yarn --frozen-lockfile --ignore-optional
      env:
        CI: true
    - name: Lint
      run: yarn lint
      env:
        CI: true
    - name: Test
      run: yarn test
      env:
        CI: true
    - name: Build
      run: yarn build
      env:
        CI: true

  publish:
    name: Publish to NPM
    runs-on: ubuntu-latest
    needs:
      - tests
    steps:
    - uses: actions/checkout@master
    - uses: actions/setup-node@v1
      with:
        node-version: 14.x
        registry-url: https://registry.npmjs.org
    - name: install global module
      run: |
        npm install -g yarn
      if: contains(github.ref, 'tags/v')
    - name: Install dependencies
      run: yarn install --frozen-lockfile --ignore-optional
      if: contains(github.ref, 'tags/v')
      env:
        CI: true
    - name: Build
      run: yarn build
      if: contains(github.ref, 'tags/v')
    - name: Publish to NPM
      run: npm publish
      env:
        NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
      if: contains(github.ref, 'tags/v')