CI/CD Pipeline¶
This document describes the continuous integration and deployment pipelines for the tg-note project.
GitHub Actions Workflows¶
Publish to PyPI¶
The project uses GitHub Actions to automatically publish releases to PyPI using Trusted Publishing (OIDC authentication).
Workflow file: .github/workflows/publish-to-pypi.yml
Triggers: - When a new release is published on GitHub - Manual workflow dispatch
What it does: 1. Checks out the repository 2. Sets up Python 3.11 3. Installs Poetry and project dependencies 4. Builds the distribution packages 5. Publishes to PyPI using trusted publishing (no API tokens required)
Environment: pypi
For detailed setup instructions, see PyPI Trusted Publisher Setup.
Setting Up CI/CD¶
PyPI Publishing¶
To enable automatic publishing to PyPI:
- Configure a trusted publisher on PyPI (see setup guide)
- Create a
pypi
environment in GitHub repository settings - (Optional) Add protection rules to the environment
Creating a Release¶
To trigger a new PyPI release:
- Via GitHub UI:
- Go to Releases → Draft a new release
- Create a new tag (e.g.,
v0.1.0
) -
Publish the release
-
Via Git CLI:
-
Via GitHub CLI:
The workflow will automatically build and publish the package to PyPI.
Future Improvements¶
Potential additions to the CI/CD pipeline:
- Automated testing on pull requests
- Code quality checks (linting, type checking)
- Documentation deployment
- Docker image building and publishing
- Automated changelog generation