Skip to content
Draft
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
53 changes: 53 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release Please

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

jobs:
release-please:
name: Release PR / tag
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release

publish:
name: Publish to PyPI
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/datamasque-cli
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag_name }}

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python
run: uv python install 3.12

- name: Build
run: uv build

- name: Validate distributions
run: uvx twine check dist/*

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
62 changes: 0 additions & 62 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.3.0"
}
40 changes: 24 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,29 +209,37 @@ A few project-specific conventions on top of the generic style above:

## Commit messages

Use [Conventional Commits](https://www.conventionalcommits.org/) format where practical:
Use [Conventional Commits](https://www.conventionalcommits.org/) format:
`feat: add dm run retry command`,
`fix: handle 401 retry for multipart uploads`,
`docs: clarify connections update semantics`,
and so on.

## Releasing

Releases are published automatically by CI when a version tag is pushed.

```console
make release-patch # 0.1.0 → 0.1.1 — bug fixes
make release-minor # 0.1.0 → 0.2.0 — new features
make release-major # 0.1.0 → 1.0.0 — breaking changes
```
The commit type drives the next release:
`fix:` bumps the patch version,
`feat:` the minor version,
and a `!` or `BREAKING CHANGE:` footer the major version.
The changelog is generated from these subjects,
so write them for whoever reads the release notes.
See [Releasing](#releasing).

Each target runs `make check`,
bumps the version in `pyproject.toml`,
refreshes `uv.lock`,
commits, tags, and pushes.
CI handles the publish to PyPI.
## Releasing

To smoke-test a release against TestPyPI without tagging,
Releases are automated with
[release-please](https://github.com/googleapis/release-please).
You do not bump the version or edit the changelog by hand.

As Conventional Commits land on `main`,
release-please maintains an open release PR
that bumps the version in `pyproject.toml`
and updates `CHANGELOG.md` from the commit messages.
To cut a release,
review and merge that PR:
the merge tags the commit,
publishes the GitHub release,
and uploads to PyPI.

To smoke-test a build against TestPyPI without releasing,
trigger the `Release (TestPyPI)` workflow manually from the GitHub Actions tab.

## Toolchain
Expand Down
33 changes: 1 addition & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: install lint format mypy test test-integration test-integration-local check build release-patch release-minor release-major
.PHONY: install lint format mypy test test-integration test-integration-local check build

install:
uv sync
Expand Down Expand Up @@ -32,34 +32,3 @@ format-check:

build:
uv build

# Bump version, commit, tag, push — CI publishes automatically.
# Usage: make release-patch (0.1.0 → 0.1.1)
# make release-minor (0.1.0 → 0.2.0)
# make release-major (0.1.0 → 1.0.0)
release-patch: check
$(eval VERSION := $(shell python3 scripts/bump_version.py patch))
uv lock
git add pyproject.toml uv.lock
git commit -m "Release v$(VERSION)"
git tag "v$(VERSION)"
git push && git push --tags
@echo "Released v$(VERSION) — CI will publish to PyPI (https://pypi.org/p/datamasque-cli)"

release-minor: check
$(eval VERSION := $(shell python3 scripts/bump_version.py minor))
uv lock
git add pyproject.toml uv.lock
git commit -m "Release v$(VERSION)"
git tag "v$(VERSION)"
git push && git push --tags
@echo "Released v$(VERSION) — CI will publish to PyPI (https://pypi.org/p/datamasque-cli)"

release-major: check
$(eval VERSION := $(shell python3 scripts/bump_version.py major))
uv lock
git add pyproject.toml uv.lock
git commit -m "Release v$(VERSION)"
git tag "v$(VERSION)"
git push && git push --tags
@echo "Released v$(VERSION) — CI will publish to PyPI (https://pypi.org/p/datamasque-cli)"
10 changes: 10 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"packages": {
".": {
"release-type": "python",
"package-name": "datamasque-cli"
}
}
}
40 changes: 0 additions & 40 deletions scripts/bump_version.py

This file was deleted.

Loading