Skip to content

chore: introduce changeset #73

chore: introduce changeset

chore: introduce changeset #73

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 16.x, 18.x, 20.x ]
mongodb-version: [ ^4.0.0, ^5.0.0, ^6.0.0 ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup MongoDB
run: pnpm install --filter=@fizzbuds/ddd-toolkit mongodb@${{ matrix.mongodb-version }}
- name: Build
run: pnpm run build
- name: Test
run: pnpm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
version:
runs-on: ubuntu-latest
#needs: build
#if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest
- name: Setup Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@fizzbuds'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate changeset from conventional commits
run: pnpm dlx changeset-conventional-commits
- name: Create and publish versions
uses: changesets/action@v1
# with:
# publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}