Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 32 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,64 @@
name: Release

# Publishes the package to (Test)PyPI via Trusted Publishing (OIDC) — no API
# tokens are stored. Run manually and pick the target index: publish to
# `testpypi` first, verify, then run again with `pypi`.
on:
push:
branches:
- main
workflow_dispatch:
inputs:
target:
description: Package index to publish to
required: true
type: choice
default: testpypi
options:
- testpypi
- pypi

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
PYTHON_VERSION: '3.12'

jobs:
release-please:
name: Release Please
if: github.repository == 'capawesome-team/cloud-python'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
steps:
- name: Create release pull request or GitHub release
id: release-please
uses: googleapis/release-please-action@v4

build:
name: Build
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: '3.12'
python-version: ${{ env.PYTHON_VERSION }}
- name: Build distributions
run: |
python -m pip install --upgrade pip build
python -m pip install --upgrade pip build twine
python -m build
- name: Check distributions
run: |
python -m pip install --upgrade twine
python -m twine check dist/*
- name: Upload distributions
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/

publish-testpypi:
name: Publish to TestPyPI
if: ${{ inputs.target == 'testpypi' }}
needs: build
runs-on: ubuntu-latest
environment: testpypi
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-pypi:
publish:
name: Publish to PyPI
if: ${{ inputs.target == 'pypi' }}
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
id-token: write # Required for PyPI trusted publishing
steps:
- name: Download distributions
uses: actions/download-artifact@v8
Expand Down
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

## 0.1.0 (2026-06-02)

### Feat
### Features

- add Capawesome Cloud Python SDK (#1)
- add Capawesome Cloud Python SDK ([#1](https://github.com/capawesome-team/cloud-python/issues/1)) ([80d28ba](https://github.com/capawesome-team/cloud-python/commit/80d28ba519e5fcd98274410c3c76493768a581d3))
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
```

Commit messages follow [Conventional Commits](https://www.conventionalcommits.org), enforced by [Commitizen](https://commitizen-tools.github.io/commitizen/) — run `cz commit` for a guided prompt. Common commands during development:
Common commands during development:

| Command | Description |
| ------------------------------------------ | -------------------------------------- |
Expand All @@ -315,7 +315,6 @@ Commit messages follow [Conventional Commits](https://www.conventionalcommits.or
| `ruff format src tests examples` | Auto-format the code. |
| `ruff format --check src tests examples` | Check formatting without writing. |
| `mypy` | Type-check the package. |
| `cz commit` | Create a Conventional Commit. |

### Testing

Expand All @@ -328,12 +327,9 @@ pytest --cov=capawesome_cloud # run with a coverage report

### Publishing

Releases are driven by [Commitizen](https://commitizen-tools.github.io/commitizen/), which derives the next version and changelog entries from [Conventional Commits](https://www.conventionalcommits.org).
Releases are automated with [Release Please](https://github.com/googleapis/release-please), which derives the next version and changelog entries from [Conventional Commits](https://www.conventionalcommits.org).

1. Make sure `main` is up to date and CI is green.
2. Run `cz bump`. This bumps the version (in `[tool.commitizen]` and `src/capawesome_cloud/_version.py`), regenerates `CHANGELOG.md`, and creates a release commit plus a matching `vX.Y.Z` tag — all locally, nothing is pushed yet. Pass `--dry-run` first if you want to preview the result.
3. Review the generated commit and changelog, then push everything: `git push --follow-tags origin main`.
4. Build the distributions with `python -m build`, then publish to PyPI with `python -m twine upload dist/*` (requires `pip install build twine`).
On every push to `main`, the [Release workflow](./.github/workflows/release.yml) creates or updates a release pull request that bumps the version and updates `CHANGELOG.md`. Merging that pull request creates the git tag and GitHub release, and publishes the package to PyPI.

## License

Expand Down
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ dev = [
"respx>=0.21",
"ruff>=0.6",
"mypy>=1.11",
"commitizen>=3.29",
]

[tool.hatch.version]
Expand Down Expand Up @@ -77,10 +76,3 @@ files = ["src"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra"

[tool.commitizen]
version = "0.1.0"
version_files = ["src/capawesome_cloud/_version.py:__version__"]
tag_format = "v$version"
update_changelog_on_bump = true
major_version_zero = true
12 changes: 12 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "python",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"include-component-in-tag": false,
"packages": {
".": {
"extra-files": ["src/capawesome_cloud/_version.py"]
}
}
}
2 changes: 1 addition & 1 deletion src/capawesome_cloud/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.1.0" # x-release-please-version
Loading