Skip to content

Fix example project styles and READMEs (#32) #108

Fix example project styles and READMEs (#32)

Fix example project styles and READMEs (#32) #108

Workflow file for this run

name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- "v*"
jobs:
check-format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
- name: Check format in library
run: npm run check-format
- name: Check format in logger example
run: cd examples/logger && npm install && npm run check-format
- name: Check format in rpc-app-router example
run: cd examples/trpc-app-router && npm install && npm run check-format
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 18.x
- 20.x
- 22.x
- 24.x
- latest
install-cmd:
- npm install
- npm update
exclude:
- node: 18.x
install-cmd: npm update
- node: 19.x
install-cmd: npm update
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: ${{ matrix.install-cmd }}
- name: Building library
run: npm run build
- name: Running tests
run: npm test
- name: Building logger example
run: cd examples/logger && ${{ matrix.install-cmd }} && npm run build
- name: Building rpc-app-router example
run: cd examples/trpc-app-router && ${{ matrix.install-cmd }} && npm run build
publish:
name: Publish
needs:
- check-format
- build-and-test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODEVERSION }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
- uses: softprops/action-gh-release@v1