-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix update process for nightly branch
- Loading branch information
1 parent
e2dbbac
commit 84c7a25
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,19 @@ def main() -> None: | |
required=True, | ||
help="The owner and name of the repository. (Ex. GsLogiMaker/glecs_godot_plugin)", | ||
) | ||
p.add_argument( | ||
"--message", | ||
type=str, | ||
required=True, | ||
help="The commit message for the nightly update", | ||
) | ||
|
||
args = p.parse_args() | ||
|
||
os.mkdir("../nightly") | ||
clone_nightly(args.repository) | ||
copy_dev_plugin_to_nightly() | ||
commit_to_nightly(args.message) | ||
|
||
def clone_nightly(repo:str) -> None: | ||
subprocess.run(["git", "clone", f"https://github.com/{repo}", f"../nightly_tmp", "-b", "nightly"]) | ||
|
@@ -67,14 +74,17 @@ def copy_dev_plugin_to_nightly() -> None: | |
continue | ||
shutil.copy(path, os.path.join("../nightly/", path)) | ||
|
||
def commit_to_nightly() -> None: | ||
def commit_to_nightly(commit_message:str) -> None: | ||
cwd = os.getcwd() | ||
subprocess.run(["cd", "../nightly"]) | ||
os.chdir("../nightly") | ||
subprocess.run(["git", "config", "--global", "user.name", "github-actions[bot]"]) | ||
subprocess.run(["git", "config", "--global", "user.email", "[email protected]"]) | ||
subprocess.run(["git", "commit", "--all", "-m", "(AUTO) ${{ github.event.head_commit.message }}"]) | ||
subprocess.run(["cd", cwd]) | ||
subprocess.run(["git", "commit", "--all", "-m", f"(AUTO) {commit_message}"]) | ||
os.chdir(cwd) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
|
||
|
||
|