lipp/node-jet

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: node-jet CI
env:
  NODE_VERSION: '20.8'
on:
  release:
    types: [created]
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ env.NODE_VERSION }}
      - run: npm ci
      - run: npm run ci:eslint
      - run: npm run ci:prettier
      - run: npm run ci:type-check
      - run: npm test

  publish-npm:
    if: startsWith(github.ref, 'refs/tags/v')
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ env.NODE_VERSION }}
          registry-url: https://registry.npmjs.org/
      - run: npm ci
      - run: git config --global user.email "schopp@hbkworld.com"
      - run: git config --global user.name "Florian Schopp"
      - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
      - run: echo ${{ env.RELEASE_VERSION }}
      - run: npm version ${{ env.RELEASE_VERSION }} --no-git-tag-version
      - run: npm run build
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.npm_token}}