This directory contains GitHub Actions workflows for the cdk_auto_platform Python package.
Trigger: Push to main or develop branches, and pull requests
Purpose: Validates that the package can be built successfully across multiple Python versions.
What it does:
- Runs on Python 3.11 and 3.12
- Installs dependencies
- Builds the package
- Validates the package with
twine check - Uploads build artifacts
Trigger: Manual workflow dispatch only
Purpose: Automates version bumping, PyPI publishing, and GitHub release creation.
What it does:
- Bumps the version (patch/minor/major) using
bump-my-version - Commits and tags the new version
- Builds the Python package (wheel and source distribution)
- Publishes to PyPI using Trusted Publishing (OIDC)
- Creates a GitHub Release with the built distributions attached
How to use:
- Go to Actions > Create Release
- Click "Run workflow"
- Select bump type (patch, minor, or major)
- Click "Run workflow"
Or via CLI:
gh workflow run release.yml -f bump_type=patch -f create_release=trueExample:
- Current version:
1.0.45 - Bump type:
patch - New version:
1.0.46
The workflow uses PyPI Trusted Publishing (OIDC) for secure, token-free publishing:
- No API tokens: Uses OpenID Connect for authentication
- Secure: No secrets to manage or rotate
- Simple: Works automatically once configured
- Go to https://pypi.org/manage/account/publishing/
- Add a new "pending publisher" with:
- PyPI Project Name:
cdk-auto-platform - Owner:
cesarmoralesonya - Repository name:
cdk-auto-platform - Workflow name:
release.yml - Environment name: (leave empty)
- PyPI Project Name:
- Click "Add"
# Install latest version
pip install cdk-auto-platform
# Install specific version
pip install cdk-auto-platform==1.0.58pip install https://github.com/cesarmoralesonya/cdk-auto-platform/releases/download/1.0.58/cdk_auto_platform-1.0.58-py3-none-any.whl# requirements.txt
cdk-auto-platform==1.0.58
The project uses bump-my-version for version management. The version is stored in two places:
src/pyproject.toml(field:tool.bumpversion.current_version)src/cdk_auto_platform/__init__.py(variable:__version__)
If you need to bump the version manually:
cd src
pip install bump-my-version
bump-my-version bump patch # or minor, or major
git push origin main --follow-tagsCheck:
- Trusted Publishing is configured correctly on PyPI
- The workflow name in PyPI matches
release.yml - The repository owner and name are correct
Check:
- Python version compatibility (3.11+)
- All dependencies are correctly specified in
pyproject.toml - The package structure follows Python packaging standards
If you see version conflicts:
- Ensure
pyproject.tomland__init__.pyhave matching versions - Check that tags are properly pushed to GitHub
- Verify no duplicate versions exist on PyPI