Skip to content

CI

CI #2206

Workflow file for this run

name: CI
on:
push:
branches:
- master
- "v*"
tags:
- "v*"
pull_request:
schedule:
- cron: '0 3 * * *' # daily, at 3am
env:
PNPM_VERSION: 7.33.7
jobs:
tests:
name: "Tests on Node.js ${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version:
- 14
- 16
- 18
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/setup-node@v3.8.2
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2.4.0
with:
version: ${{ env.PNPM_VERSION }}
- run: pnpm install
- run: pnpm test -- --coverage
release:
name: Release
runs-on: ubuntu-latest
needs:
- tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3.6.0
- uses: actions/setup-node@v3.8.2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v2.4.0
with:
version: ${{ env.PNPM_VERSION }}
- run: pnpm install --frozen-lockfile
- name: auto-dist-tag
run: pnpx auto-dist-tag@1 --write
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}