fix: Fix package root path calculation in rules service #35
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: codingbuddy-canary | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - stag-** | |
| paths: | |
| - 'mcp-server/**' | |
| - '.ai-rules/**' | |
| - '.antigravity/**' | |
| - '.claude/**' | |
| - '.codex/**' | |
| - '.cursor/**' | |
| - 'scripts/**' | |
| - .github/workflows/canary.yml | |
| permissions: | |
| statuses: write | |
| contents: read | |
| jobs: | |
| publish-canary: | |
| if: github.repository == 'JeremyDev87/codingbuddy' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: mcp-server | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Restore dependencies from cache | |
| id: cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ./mcp-server/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/mcp-server/yarn.lock')) }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: yarn install --immutable | |
| - name: Build | |
| run: yarn build | |
| - name: Publish canary | |
| run: | | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| COMMIT_SHA=${GITHUB_SHA::7} | |
| VERSION="0.0.0-canary.${TIMESTAMP}.${COMMIT_SHA}" | |
| cat <<< "$( jq --arg v "$VERSION" '.version = $v' package.json )" > package.json | |
| yarn npm publish --tag canary | |
| env: | |
| YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_SHA: ${{ github.sha }} | |
| - name: Output canary version number | |
| run: | | |
| name=$(jq -r .name package.json) | |
| version=$(jq -r .version package.json) | |
| yarn dlx action-status --context "Published $name" --state success --description $version --url "https://unpkg.com/$name@$version/" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |