Skip to content

fix: package.json & yarn.lock to reduce vulnerabilities #1312

fix: package.json & yarn.lock to reduce vulnerabilities

fix: package.json & yarn.lock to reduce vulnerabilities #1312

Workflow file for this run

name: test-and-publish
on: [push]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Restore cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: yarn lint
env:
CI: true
unit-test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Restore cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: yarn test
env:
CI: true
type-test:
name: Type test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Restore cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install
- run: yarn test:types
publish:
name: Publish
runs-on: ubuntu-latest
needs: unit-test
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build and publish release.
run: yarn install
- name: Publish via Semantic Release
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISHING_TOKEN }}