Skip to content

chore(deps): update linters to v7 (major) #367

chore(deps): update linters to v7 (major)

chore(deps): update linters to v7 (major) #367

Workflow file for this run

name: CI & Release
on:
# Build on pushes to release branches
push:
branches: [main]
# Build on pull requests targeting release branches
pull_request:
branches: [main]
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# https://github.com/sanity-io/semantic-release-preset/actions/workflows/ci.yml
workflow_dispatch:
inputs:
release:
description: 'Release new version'
required: true
default: false
type: boolean
jobs:
test:
runs-on: ${{ matrix.platform }}
name: Node.js ${{ matrix.node-version }} / ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
# Test the oldest Node.js version we support, the latest LTS release and the current version in development
node-version: [12, lts/*, current]
include:
# mac and windows only need to test the LTS version of node
- platform: macos-latest
node-version: lts/*
- platform: windows-latest
node-version: lts/*
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
release:
name: 'Semantic release'
needs: test
runs-on: ubuntu-latest
if: inputs.release == true
steps:
- uses: actions/checkout@v3
with:
# Need to fetch entire commit history to
# analyze every commit since last release
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: npm
- run: npm ci
# Branches that will release new versions are defined in .releaserc.json
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}