mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
tools: switch to new releasing strategy
This commit is contained in:
parent
3061bf4651
commit
5f0e321bac
2 changed files with 17 additions and 4 deletions
|
@ -45,7 +45,11 @@ class CommitCommand(BaseCommand):
|
|||
|
||||
def run(self, args: argparse.Namespace, options: Options) -> None:
|
||||
# self.git.checkout_branch("develop")
|
||||
old_tag = self.git.get_branch_version(pattern=f"tr{args.game_version}-*", branch="origin/stable", abbrev=0)
|
||||
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
|
||||
|
@ -68,8 +72,6 @@ class CommitCommand(BaseCommand):
|
|||
changelog_path.write_text(new_changelog)
|
||||
self.git.add(changelog_path)
|
||||
self.git.commit(f"docs/tr{args.game_version}: release {args.version}")
|
||||
self.git.delete_tag(new_tag)
|
||||
self.git.create_tag(new_tag)
|
||||
|
||||
|
||||
class BranchCommand(BaseCommand):
|
||||
|
@ -79,7 +81,11 @@ class BranchCommand(BaseCommand):
|
|||
def run(self, args: argparse.Namespace, options: Options) -> None:
|
||||
new_tag = f"tr{args.game_version}-{args.version}"
|
||||
self.git.checkout_branch("stable")
|
||||
self.git.reset(new_tag, hard=True)
|
||||
self.git.merge_reset(
|
||||
"develop", text=f"{args.game_version}: release {args.version}"
|
||||
)
|
||||
self.git.delete_tag(new_tag)
|
||||
self.git.create_tag(new_tag)
|
||||
self.git.checkout_branch("develop")
|
||||
|
||||
|
||||
|
|
|
@ -16,6 +16,13 @@ class Git:
|
|||
["git", "reset", "develop", *(["--hard"] if hard else [])]
|
||||
)
|
||||
|
||||
def merge_reset(self, target: str, text: str) -> None:
|
||||
self.check_output(
|
||||
["git", "merge", target, "--strategy=ours", "--no-commit"]
|
||||
)
|
||||
self.check_output(["git", "read-tree", "-u", "--reset", target])
|
||||
self.check_output(["git", "commit", "-m", text])
|
||||
|
||||
def delete_tag(self, tag_name: str) -> None:
|
||||
self.grab_output(["git", "tag", "-d", tag_name])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue