Changelog: note TypeScript declarations and Node 22 requirement #118
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: [22.x, 24.x] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| 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@v7 | |
| - uses: actions/setup-node@v6 | |
| 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] | |
| environment: npm-publish | |
| permissions: | |
| contents: read # Required for actions/checkout | |
| id-token: write # Required for trusted publishing to NPM | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| 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: Ensure npm 11.5.1 or later for trusted publishing | |
| run: npm install -g npm@11.7.0 | |
| - 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') || '' )}} |