diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1fe1669..6c2256f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,38 +1,50 @@ 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 @@ -40,33 +52,13 @@ jobs: 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 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..466df71 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index adea622..9252fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/README.md b/README.md index 5213fde..73b310c 100644 --- a/README.md +++ b/README.md @@ -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 | | ------------------------------------------ | -------------------------------------- | @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index ee28b0b..0f20759 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,6 @@ dev = [ "respx>=0.21", "ruff>=0.6", "mypy>=1.11", - "commitizen>=3.29", ] [tool.hatch.version] @@ -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 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..8269847 --- /dev/null +++ b/release-please-config.json @@ -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"] + } + } +} diff --git a/src/capawesome_cloud/_version.py b/src/capawesome_cloud/_version.py index 3dc1f76..75716eb 100644 --- a/src/capawesome_cloud/_version.py +++ b/src/capawesome_cloud/_version.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.0" # x-release-please-version