fix: solve publish package #9
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: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: install dependencies | |
run: npm ci | |
- name: lint code | |
run: npm run lint | |
build: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
node: ['16', '18', '20'] | |
name: Tests - Node ${{ matrix.node }} (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: install dependencies | |
run: npm ci --ignore-engines | |
- name: run tests | |
run: npm run test | |
release: | |
name: do semantic release | |
runs-on: 'ubuntu-latest' | |
permissions: | |
contents: write | |
issues: write | |
needs: build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: install dependencies | |
run: npm ci --ignore-engines | |
- name: release | |
run: npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
NPM_TOKEN: ${{secrets.NPM_TOKEN}} |