chore: Include dist/ in repository for Smithery deployment #18
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/CD | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test-python: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: python | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| - run: uv sync | |
| - name: Run tests with coverage | |
| run: uv run pytest --cov=src --cov-report=term-missing --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| files: python/coverage.xml | |
| fail_ci_if_error: false | |
| test-typescript: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: typescript | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm test | |
| continue-on-error: true # Tests are optional for now | |
| build-python: | |
| needs: test-python | |
| if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: python | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v4 | |
| - run: uv build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: python/dist/ | |
| publish-python: | |
| needs: build-python | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Publish to PyPI (Trusted Publishing) | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| continue-on-error: true | |
| id: oidc | |
| - name: Publish to PyPI (Token fallback) | |
| if: steps.oidc.outcome == 'failure' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_TOKEN }} |