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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ Eventually, pushing the release tag to origin is what triggers `release.yml`,
which builds and publishes to PyPI.
Nothing is uploaded from a developer machine and no PyPI token exists anywhere.

A repository that publishes no package, but release files of its own,
names itself in its root `pyproject.toml`, and may name a file that carries its version,
which the release commit then sets beside CHANGELOG.md:

[tool.make-new-release]
name = "cmrelay"
version-file = "host/VERSION"


## PyPI trusted publishing (OIDC) setup

Expand Down
11 changes: 10 additions & 1 deletion scripts/make_new_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ def read_pyproject():
return tomllib.load(f)


def release_settings():
"""[tool.make-new-release]: `name` and `version-file` of a repo without a package."""
return read_pyproject().get("tool", {}).get("make-new-release", {})


def get_project_name():
"""Reads the project name from pyproject.toml."""
return read_pyproject()["project"]["name"]
return release_settings().get("name") or read_pyproject()["project"]["name"]


def get_test_dependencies():
Expand Down Expand Up @@ -464,6 +469,10 @@ def main():
return

changed = update_changelog(tag)
if version_file := release_settings().get("version-file"):
Path(version_file).write_text(f"{next_ver}\n")
run(["git", "add", version_file])
changed = True
if changed:
run(["git", "add", "CHANGELOG.md"])
if run(["git", "commit", "-m", f"chore: release {tag}"]) != 0:
Expand Down