Upgrade eslint-plugin-jest from 28.14.0 to 29.12.1 #210
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
| name: Build | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [18.x] | |
| os: [ubuntu-latest] | |
| steps: | |
| - name: Check out code repository source code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run build | |
| run: npm run build | |
| - name: Run lint | |
| run: npm run lint | |
| # Publishing is done in a separate job to allow | |
| # for all matrix builds to complete. | |
| release: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.x | |
| cache: 'npm' | |
| - name: Check if publish needed | |
| id: publish | |
| run: | | |
| name="$(jq -r .name package.json)" | |
| npmver="$(npm show $name version || echo v0.0.0)" | |
| pkgver="$(jq -r .version package.json)" | |
| if [ "$npmver" = "$pkgver" ] | |
| then | |
| echo "Package version ($pkgver) is the same as last published NPM version ($npmver), skipping publish." | |
| echo "publish=false" >> $GITHUB_ENV | |
| echo "publish=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "Package version ($pkgver) is different from latest NPM version ($npmver), publishing!" | |
| echo "publish=true" >> $GITHUB_ENV | |
| echo "publish=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Publish | |
| if: steps.publish.outputs.publish == 'true' | |
| env: | |
| NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc | |
| npm publish |