Fix MCP Registry image tag: latest → main #24
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] | |
| env: | |
| DOCKER_REGISTRY: ghcr.io | |
| IMAGE_NAME: ghcr.io/codealive-ai/codealive-mcp | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.11' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[test]" | |
| pip install jsonschema | |
| - name: Run tests | |
| run: | | |
| python -m pytest src/tests/ -v --cov=src --cov-report=term-missing --cov-report=xml --junitxml=junit/test-results.xml | |
| - name: Upload test results | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| if: always() | |
| with: | |
| name: pytest-results | |
| path: | | |
| junit/test-results.xml | |
| coverage.xml | |
| package: | |
| name: Package Extension | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.11' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Build MCPB bundle | |
| run: | | |
| mkdir -p dist | |
| npx -y @anthropic-ai/mcpb pack . dist/codealive-mcp.mcpb | |
| - name: Verify MCPB bundle contents | |
| run: | | |
| python scripts/verify_mcpb.py dist/codealive-mcp.mcpb | |
| - name: Upload MCPB artifact | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: codealive-mcpb | |
| path: dist/codealive-mcp.mcpb | |
| docker: | |
| name: Build & Push Docker | |
| needs: [test, package] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Login to GitHub Container Registry | |
| if: github.event_name == 'push' | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: ${{ env.DOCKER_REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # PR: build only (no push) to validate Dockerfile — single platform for speed | |
| - name: Build Docker image (PR validation) | |
| if: github.event_name == 'pull_request' | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| push: false | |
| load: true | |
| file: ./Dockerfile | |
| tags: ${{ env.IMAGE_NAME }}:pr-${{ github.event.number }} | |
| cache-from: type=gha | |
| # Push to main: build multi-platform and push with rolling tags | |
| - name: Build and push Docker image | |
| if: github.event_name == 'push' | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| file: ./Dockerfile | |
| tags: ${{ env.IMAGE_NAME }}:main | |
| labels: | | |
| io.modelcontextprotocol.server.name=io.github.CodeAlive-AI/codealive-mcp | |
| cache-from: type=gha | |
| cache-to: type=gha |