refactor CI workflow to build and publish with Node.js 18.x
Some checks are pending
CI / build-and-publish (push) Waiting to run
Some checks are pending
CI / build-and-publish (push) Waiting to run
This commit is contained in:
parent
bb18ffc49b
commit
b6e5c5b1e4
1 changed files with 8 additions and 22 deletions
|
@ -7,39 +7,25 @@ on:
|
|||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x, 18.x, 20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: "18.x"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Generate coverage
|
||||
run: npm run test:coverage
|
||||
|
||||
- name: Archive coverage
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-${{ matrix.node-version }}
|
||||
path: coverage
|
||||
retention-days: 5
|
||||
- name: Publish to NPM
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
|
||||
|
|
Loading…
Add table
Reference in a new issue