From b9a301d0bc8be36d49815d616a61037ffb8ae39d Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sat, 7 Jun 2025 14:46:15 -0600 Subject: [PATCH 1/2] chore(config): add version stamp to github-actions examples in documentation --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 7a3aa918a..8dc8935a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -414,6 +414,8 @@ build_command = """ major_on_zero = true version_variables = [ "src/gh_action/requirements.txt:python-semantic-release:nf", + "docs/configuration/automatic-releases/github-actions.rst:python-semantic-release/python-semantic-release:tf", + "docs/configuration/automatic-releases/github-actions.rst:python-semantic-release/publish-action:tf", ] version_toml = ["pyproject.toml:project.version"] From e41791ec6734392040bd4aa71703f87fa3a66c6f Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sat, 7 Jun 2025 14:47:18 -0600 Subject: [PATCH 2/2] chore(scripts): drop code to bump versions of github-action examples in documentation --- scripts/bump_version_in_docs.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/scripts/bump_version_in_docs.py b/scripts/bump_version_in_docs.py index 7c6104791..3155cd0c7 100644 --- a/scripts/bump_version_in_docs.py +++ b/scripts/bump_version_in_docs.py @@ -12,25 +12,6 @@ tag_replace_pattern = regexp(r"\$(NEW_RELEASE_TAG|{NEW_RELEASE_TAG})") -def update_github_actions_example(filepath: Path, release_tag: str) -> None: - psr_regex = regexp(r"(uses: python-semantic-release/python-semantic-release)@\S+$") - psr_publish_action_regex = regexp( - r"(uses: python-semantic-release/publish-action)@\S+$" - ) - file_content_lines: list[str] = filepath.read_text().splitlines() - - for regex in [psr_regex, psr_publish_action_regex]: - file_content_lines = list( - map( - lambda line, regex=regex: regex.sub(r"\1@" + release_tag, line), # type: ignore[misc] - file_content_lines, - ) - ) - - print(f"Bumping version in {filepath} to", release_tag) - filepath.write_text(str.join("\n", file_content_lines) + "\n") - - def envsubst(filepath: Path, version: str, release_tag: str) -> None: file_content = filepath.read_text() @@ -59,10 +40,5 @@ def envsubst(filepath: Path, version: str, release_tag: str) -> None: print("NEW_VERSION environment variable is not set") exit(1) - update_github_actions_example( - DOCS_DIR / "configuration" / "automatic-releases" / "github-actions.rst", - new_release_tag, - ) - for doc_file in DOCS_DIR.rglob("*.rst"): envsubst(filepath=doc_file, version=new_version, release_tag=new_release_tag)