.github/workflows/release.yml
name: release
on:
push:
branches:
- master
env:
NODE_ENV: test
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2.1.1
- uses: actions/checkout@v2
- run: npm audit --audit-level=moderate
test:
needs: audit
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10, 12, 13, 14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v2.1.1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: client-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:ci
release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ahmadnassri/action-semantic-release@v1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}