feat: bundle for both ESM and CJS; migrate to vitest #18
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-unix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ['ubuntu-latest'] | |
node-version: [18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm ci --ignore-scripts | |
npm audit fix | |
- name: Test | |
run: npm run build && npm test | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Send coverage report with Code Climate | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov | |
publish-npm: | |
needs: ['build-unix'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- run: | | |
npm ci --ignore-scripts | |
npm run build | |
git config --global user.email ${{ secrets.GIT_EMAIL }} | |
git config --global user.name ${{ secrets.GIT_NAME }} | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |