BREAKING CHANGE: drop CommonJS support #51
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: Build, lint, test | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Volta and Node.js | |
uses: volta-cli/action@v3 | |
- run: npm ci | |
- run: npm run build | |
- run: npm run lint | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
retention-days: 5 | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16, 18] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Download dist directory | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- run: npm ci | |
- run: npm test | |
pack: | |
needs: build | |
if: github.ref_type == 'tag' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Volta and Node.js | |
uses: volta-cli/action@v3 | |
- name: Download dist directory | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- run: mkdir out && cd dist/fancy-canvas && npm pack --pack-destination ../../out | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Package tarball | |
path: out/fancy-canvas-${{ github.ref_name }}.tgz | |
retention-days: 30 |