Skip to content

Merge pull request #151 from alecmev/tseslint-8 #88

Merge pull request #151 from alecmev/tseslint-8

Merge pull request #151 from alecmev/tseslint-8 #88

Workflow file for this run

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
name: CI
on: [push, pull_request]
jobs:
build:
name: Tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn run test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 22.x
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn run lint
- name: Prettier
run: yarn run prettier-check
release:
name: Publish to NPM
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'relayjs/eslint-plugin-relay'
needs: [build, lint]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 22.x
registry-url: https://registry.npmjs.org/
cache: 'yarn'
- name: Build latest (main) version
if: github.ref == 'refs/heads/main'
run: yarn version --no-git-tag-version --new-version 0.0.0-main-${GITHUB_SHA}
- name: Check release version matches tag
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: |
if [ $(cat package.json | jq -r '.version') != "${GITHUB_REF_NAME:1}" ]; then
echo "Version in package.json does not match tag. Did you forget to commit the package.json version bump?"
exit 1
fi
- name: Publish to npm
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: npm publish --verbose ${TAG}
env:
TAG: ${{ github.ref == 'refs/heads/main' && '--tag=main' || ((contains(github.ref_name, '-rc.') && '--tag=dev') || '' )}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}