Skip to content

Commit

Permalink
tools: fix previous release link automation
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Oct 8, 2024
1 parent 39c9822 commit 54d28b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/release
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CommitCommand(BaseCommand):

def run(self, args: argparse.Namespace, options: Options) -> None:
# self.git.checkout_branch("develop")
old_tag = self.git.get_branch_version("origin/stable")
old_tag = self.git.get_branch_version(pattern=f"tr{args.game_version}-*", branch="origin/stable", abbrev=0)
new_tag = f"tr{args.game_version}-{args.version}"

changelog_path = PROJECT_PATHS[args.game_version].changelog_path
Expand Down
7 changes: 5 additions & 2 deletions tools/shared/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ def get_current_commit_hash(self) -> str:
).stdout.strip()

def get_branch_version(
self, pattern: str | None = None, branch: str | None = None
self,
pattern: str | None = None,
branch: str | None = None,
abbrev: int = 7,
) -> str:
return self.grab_output(
[
"git",
"describe",
*([branch] if branch else ["--dirty"]),
"--always",
"--abbrev=7",
f"--abbrev={abbrev}",
"--tags",
"--exclude",
"latest",
Expand Down

0 comments on commit 54d28b0

Please sign in to comment.