WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 56af4d4

Browse files
authored
Merge pull request #3 from matrix-org/develop
Release script: revert getting tag
2 parents e90a355 + 93bb3bd commit 56af4d4

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

scripts/release.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,6 @@ def get_git_hash(directory: str) -> str:
8989
text=True)
9090
return result.stdout.strip()
9191

92-
def get_tag_or_hash(directory: str, commit_hash):
93-
result = subprocess.run(
94-
["git", "tag", "--points-at", commit_hash],
95-
cwd=directory,
96-
capture_output=True,
97-
text=True,
98-
)
99-
if result.returncode == 0 and result.stdout.strip():
100-
return result.stdout.strip().split('\n')[0] # Return the first tag, if multiple tags exist
101-
else:
102-
return commit_hash
103-
10492
def commit_and_push_changes(directory: str, message: str):
10593
try:
10694
subprocess.run(["git", "add", "."], cwd=directory, check=True)
@@ -245,12 +233,11 @@ def run_publish_close_and_release_tasks(root_project_dir, publish_task: str):
245233
override_version_in_build_version_file(build_version_file_path, args.version)
246234

247235
sdk_commit_hash = get_git_hash(sdk_path)
248-
sdk_tag_or_hash = get_tag_or_hash(sdk_commit_hash)
249-
commit_message = f"Bump {args.module.name} version to {args.version} (matrix-rust-sdk to {sdk_tag_or_hash})"
236+
commit_message = f"Bump {args.module.name} version to {args.version} (matrix-rust-sdk to {sdk_commit_hash})"
250237
commit_and_push_changes(project_root, commit_message)
251238

252239
release_name = f"{args.module.name.lower()}-v{args.version}"
253-
release_notes = f"https://github.com/matrix-org/matrix-rust-sdk/tree/{sdk_tag_or_hash}"
240+
release_notes = f"https://github.com/matrix-org/matrix-rust-sdk/tree/{sdk_commit_hash}"
254241
asset_path = get_asset_path(project_root, args.module)
255242
asset_name = get_asset_name(args.module)
256243

0 commit comments

Comments
 (0)