Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(config): add version stamp to github-actions examples in docs#1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall 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
2 changes: 2 additions & 0 deletionspyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"]

Expand Down
24 changes: 0 additions & 24 deletionsscripts/bump_version_in_docs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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()

Expand DownExpand Up@@ -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)

[8]ページ先頭

©2009-2025 Movatter.jp