feat: implement database schema and server routes for ClawKernel #10
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: | |
| push: | |
| branches: [main] | |
| tags: ['[0-9]*'] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Check — typecheck · lint · dead-code · build | |
| # Runs on Node 20 (maintenance LTS) and 22 (active LTS) in parallel. | |
| # --------------------------------------------------------------------------- | |
| check: | |
| name: check / node ${{ matrix.node }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: ['20', '22'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: npm | |
| - run: npm ci | |
| - name: TypeScript | |
| run: npm run typecheck | |
| - name: Biome | |
| run: npm run check:ci | |
| - name: Knip | |
| run: npm run knip | |
| - name: Build | |
| run: npm run build | |
| # Smoke-test the CLI and verify packed file list — Node 22 only. | |
| - name: Pack check | |
| if: matrix.node == '22' | |
| run: | | |
| node bin/clawkernel.mjs --help | |
| npm pack --dry-run 2>&1 | grep -E "dist/|bin/" | |
| # --------------------------------------------------------------------------- | |
| # Publish — runs only on v* tag push, after check passes on both nodes. | |
| # Uses npm provenance (SLSA level 2) via GitHub's OIDC token. | |
| # --------------------------------------------------------------------------- | |
| publish: | |
| name: Publish to npm | |
| needs: check | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: npm | |
| - run: npm ci | |
| - name: Publish | |
| run: npm publish --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |