Fix example project styles and READMEs (#32) #108
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |