.github/workflows/release.yaml
name: Actions
on:
push:
branches:
- master
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install Dependencies
run: npm ci
- name: Run linters
run: npm run lint
- name: Run commitlint
run: npx commitlint --from=HEAD~1
test:
name: Test
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: ['lts/hydrogen', 'lts/iron', 'lts/*']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
env:
CI: true
release:
name: Release
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm ci
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4.1.1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
branches: |
['master', 'main']