Upgrade reusable actions to Node 20 versions #55
This file contains 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: Node.js CI | |
on: | |
push: | |
branches: [main] | |
tags: [v*] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version: '18' | |
- run: npm ci | |
- run: npm run lint | |
- run: npm run test:examples | |
- run: npm pack | |
- uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: package | |
path: codeyourfuture-eslint-config-standard-*.tgz | |
install: | |
runs-on: ubuntu-22.04 | |
needs: build | |
strategy: | |
matrix: | |
eslint: [6, 7, 8] | |
node: [16, 18, 20] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version: ${{ matrix.node }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package | |
- run: npm ci | |
- run: npm run test:install | |
env: | |
ESLINT_VERSION: ${{ matrix.eslint }} | |
PACK: 'false' | |
deploy-github: | |
runs-on: ubuntu-22.04 | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package | |
- run: | | |
gh release create \ | |
'${{ github.ref_name }}' \ | |
--title '${{ github.ref_name }}' \ | |
codeyourfuture-eslint-config-standard-*.tgz | |
env: | |
GH_TOKEN: ${{ github.token }} | |
deploy-npm: | |
runs-on: ubuntu-22.04 | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: install | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_AUTH_TOKEN}" | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: package | |
- run: npm publish codeyourfuture-eslint-config-standard-*.tgz |