refactor CI workflow to build and publish with Node.js 18.x
Some checks are pending
CI / build-and-publish (push) Waiting to run

This commit is contained in:
jolts 2025-01-25 07:15:40 +02:00
parent bb18ffc49b
commit b6e5c5b1e4

View file

@ -7,39 +7,25 @@ on:
branches: [main, master] branches: [main, master]
jobs: jobs:
build: build-and-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ matrix.node-version }} node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Lint
run: npm run lint
- name: Build - name: Build
run: npm run build run: npm run build
- name: Run tests - name: Publish to NPM
run: npm test run: npm publish
env:
- name: Generate coverage NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: npm run test:coverage
- name: Archive coverage
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.node-version }}
path: coverage
retention-days: 5