-
Notifications
You must be signed in to change notification settings - Fork 0
chore: setup ci #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
chore: setup ci #23
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,56 @@ | ||
| name: ci | ||
| name: CI | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: write | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| deploy: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Set up Python | ||
| run: uv python install 3.12 | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --extra dev | ||
|
|
||
| - name: Run ruff | ||
| run: uv run ruff check src/ | ||
|
|
||
| - name: Run ruff format check | ||
| run: uv run ruff format --check src/ | ||
|
|
||
| - name: Run mypy | ||
| run: uv run mypy src/ | ||
| continue-on-error: true # TODO: Fix type errors and remove this | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Configure Git Credentials | ||
| run: | | ||
| git config user.name github-actions[bot] | ||
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| run: uv python install ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --python ${{ matrix.python-version }} --extra dev | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest -v | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Release Alpha | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| ci: | ||
| uses: ./.github/workflows/ci.yml | ||
|
|
||
| release: | ||
| needs: ci | ||
| runs-on: ubuntu-latest | ||
| concurrency: release | ||
|
|
||
| steps: | ||
| - name: Generate token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: ${{ secrets.ANAM_PUSH_BOT_APP_ID }} | ||
| private-key: ${{ secrets.ANAM_PUSH_BOT_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Set up Python | ||
| run: uv python install 3.12 | ||
|
|
||
| - name: Install semantic-release | ||
| run: uv tool install python-semantic-release | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "anam-push-bot[bot]" | ||
| git config user.email "anam-push-bot[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Semantic Release (Alpha) | ||
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| run: | | ||
| uv tool run semantic-release version --as-prerelease --prerelease-token alpha | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| skip-existing: true |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Release Stable | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version_bump: | ||
| description: "Force version bump type (leave empty for auto-detection from commits)" | ||
| required: false | ||
| type: choice | ||
| options: | ||
| - "" | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| ci: | ||
| uses: ./.github/workflows/ci.yml | ||
|
|
||
| release: | ||
| needs: ci | ||
| runs-on: ubuntu-latest | ||
| concurrency: release | ||
|
|
||
| steps: | ||
| - name: Generate token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v1 | ||
| with: | ||
| app-id: ${{ secrets.ANAM_PUSH_BOT_APP_ID }} | ||
| private-key: ${{ secrets.ANAM_PUSH_BOT_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Set up Python | ||
| run: uv python install 3.12 | ||
|
|
||
| - name: Install semantic-release | ||
| run: uv tool install python-semantic-release | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config user.name "anam-push-bot[bot]" | ||
| git config user.email "anam-push-bot[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Semantic Release (Stable) | ||
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| run: | | ||
| if [ -n "${{ inputs.version_bump }}" ]; then | ||
| uv tool run semantic-release version --${{ inputs.version_bump }} | ||
| else | ||
| uv tool run semantic-release version | ||
| fi | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to the anam-ai Python SDK will be documented in this file. | ||
|
|
||
| This project adheres to [Semantic Versioning](https://semver.org/) and uses [Conventional Commits](https://www.conventionalcommits.org/) for automated releases. | ||
|
|
||
| <!-- version list --> | ||
|
|
||
| ## v0.1.0 (2025-01-27) | ||
|
|
||
| ### Features | ||
|
|
||
| - Initial release of the anam-ai Python SDK | ||
| - WebRTC-based real-time avatar streaming | ||
| - Async/await API design | ||
| - Support for audio and video tracks | ||
| - Event-driven architecture with callbacks | ||
| - Type hints throughout |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Contributing to anam-ai Python SDK | ||
|
|
||
| Thank you for your interest in contributing to the Anam AI Python SDK! | ||
|
|
||
| ## Development Setup | ||
|
|
||
| 1. Clone the repository: | ||
| ```bash | ||
| git clone https://github.com/anam-org/python-sdk.git | ||
| cd python-sdk | ||
| ``` | ||
|
|
||
| 2. Install uv (if not already installed): | ||
| ```bash | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| ``` | ||
|
|
||
| 3. Install dependencies: | ||
| ```bash | ||
| uv sync --dev | ||
| ``` | ||
|
|
||
| 4. Run tests: | ||
| ```bash | ||
| uv run pytest -v | ||
| ``` | ||
|
|
||
| 5. Run linting: | ||
| ```bash | ||
| uv run ruff check src/ | ||
| uv run ruff format --check src/ | ||
| uv run mypy src/ | ||
| ``` | ||
|
|
||
| ## Commit Message Convention | ||
|
|
||
| This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated versioning and changelog generation. | ||
|
|
||
| ### Format | ||
|
|
||
| ``` | ||
| <type>(<scope>): <description> | ||
|
|
||
| [optional body] | ||
|
|
||
| [optional footer(s)] | ||
| ``` | ||
|
|
||
| ### Types and Version Bumps | ||
|
|
||
| | Type | Description | Version Bump | | ||
| |------|-------------|--------------| | ||
| | `feat` | A new feature | Minor (0.x.0 → 0.y.0) | | ||
| | `fix` | A bug fix | Patch (0.0.x → 0.0.y) | | ||
| | `docs` | Documentation only changes | No release | | ||
| | `style` | Code style changes (formatting, etc.) | No release | | ||
| | `refactor` | Code change that neither fixes a bug nor adds a feature | No release | | ||
| | `perf` | Performance improvement | Patch | | ||
| | `test` | Adding or updating tests | No release | | ||
| | `chore` | Maintenance tasks | No release | | ||
| | `ci` | CI/CD changes | No release | | ||
|
|
||
| ### Breaking Changes | ||
|
|
||
| For breaking changes, add `!` after the type or include `BREAKING CHANGE:` in the footer: | ||
|
|
||
| ``` | ||
| feat!: remove deprecated API methods | ||
|
|
||
| BREAKING CHANGE: The `old_method()` has been removed. Use `new_method()` instead. | ||
| ``` | ||
|
|
||
| While the project is on version 0.x, breaking changes bump the minor version. | ||
|
|
||
| ### Examples | ||
|
|
||
| ```bash | ||
| # Feature (bumps minor version) | ||
| git commit -m "feat: add support for custom TTS voices" | ||
|
|
||
| # Bug fix (bumps patch version) | ||
| git commit -m "fix: handle connection timeout gracefully" | ||
|
|
||
| # Documentation (no version bump) | ||
| git commit -m "docs: update API reference for streaming" | ||
|
|
||
| # Breaking change (bumps minor version while 0.x) | ||
| git commit -m "feat!: change event callback signature" | ||
|
|
||
| # With scope | ||
| git commit -m "fix(streaming): resolve audio sync issue" | ||
| ``` | ||
|
|
||
| ## Pull Request Process | ||
|
|
||
| 1. Create a feature branch from `main` | ||
| 2. Make your changes with appropriate tests | ||
| 3. Ensure all tests pass and linting is clean | ||
| 4. Submit a PR with a clear description | ||
| 5. Wait for review and CI checks to pass | ||
|
|
||
| ## Release Process | ||
|
|
||
| - **Alpha releases**: Automatically triggered on every merge to `main` with conventional commits | ||
| - **Stable releases**: Manually triggered via GitHub Actions workflow | ||
|
|
||
| ## Code Style | ||
|
|
||
| - Follow PEP 8 guidelines | ||
| - Use type hints for all public APIs | ||
| - Run `uv run ruff format src/` to auto-format code | ||
| - Ensure `uv run mypy src/` passes without errors |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| """Version information for anam-ai SDK.""" | ||
|
|
||
| __version__ = "1.0.0" | ||
| __version__ = "0.1.0" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.