2.2.0 #27
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Type check | |
| run: bun run typecheck | |
| - name: Build JS | |
| run: bun run build | |
| - name: Test CLI | |
| run: | | |
| node dist/cli/index.js capabilities | |
| node dist/cli/index.js analyze . -d surface -q | |
| release: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Setup Node (for npm publish) | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm for trusted publishing | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Check if version needs publishing | |
| id: version | |
| run: | | |
| CURRENT=$(node -p "require('./package.json').version") | |
| PUBLISHED=$(npm view codebase-analyzer-mcp version 2>/dev/null || echo "0.0.0") | |
| echo "current=$CURRENT" >> $GITHUB_OUTPUT | |
| echo "published=$PUBLISHED" >> $GITHUB_OUTPUT | |
| if [ "$CURRENT" != "$PUBLISHED" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "Version $CURRENT not published (npm has $PUBLISHED)" | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| echo "Version $CURRENT already published" | |
| fi | |
| - name: Build JS | |
| if: steps.version.outputs.changed == 'true' | |
| run: bun run build | |
| - name: Publish to npm (trusted publisher) | |
| if: steps.version.outputs.changed == 'true' | |
| run: npm publish --provenance --access public | |
| - name: Create GitHub Release | |
| if: steps.version.outputs.changed == 'true' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ steps.version.outputs.current }} | |
| name: v${{ steps.version.outputs.current }} | |
| generate_release_notes: true |