Fix publish of kiwix-desktop flatpak.

We cannot directly push on master. We have to create a pull request.
The CI is adapted to push a new branch. The PR has to be created manually.
This commit is contained in:
Matthieu Gautier 2023-05-03 11:48:11 +02:00
parent 868d82b384
commit 3e712db880
1 changed files with 6 additions and 2 deletions

View File

@ -433,6 +433,10 @@ def update_flathub_git():
command = ["git", "clone", FLATPAK_HTTP_GIT_REMOTE] command = ["git", "clone", FLATPAK_HTTP_GIT_REMOTE]
call(command, cwd=TMP_DIR) call(command, cwd=TMP_DIR)
branch_name = "v_{}".format(get_postfix("kiwix-desktop"))
command = ["git", "checkout", "-b", branch_name]
call(command)
shutil.copy(str(BASE_DIR / "org.kiwix.desktop.json"), str(git_repo_dir)) shutil.copy(str(BASE_DIR / "org.kiwix.desktop.json"), str(git_repo_dir))
patch_dir = KBUILD_SOURCE_DIR / "kiwixbuild" / "patches" patch_dir = KBUILD_SOURCE_DIR / "kiwixbuild" / "patches"
for dep in ["pugixml"]: for dep in ["pugixml"]:
@ -444,7 +448,7 @@ def update_flathub_git():
"git", "git",
"commit", "commit",
"-m", "-m",
"Update to version {}".format(main_project_versions["kiwix-desktop"]), "Update to version {}".format(get_postfix("kiwix-desktop")),
] ]
try: try:
call(command) call(command)
@ -453,7 +457,7 @@ def update_flathub_git():
return return
command = ["git", "config", "remote.origin.pushurl", FLATPAK_GIT_REMOTE] command = ["git", "config", "remote.origin.pushurl", FLATPAK_GIT_REMOTE]
call(command) call(command)
command = ["git", "push"] command = ["git", "push", "origin", branch_name]
env["GIT_SSH_COMMAND"] = "ssh -o StrictHostKeyChecking=no -i " + _environ.get( env["GIT_SSH_COMMAND"] = "ssh -o StrictHostKeyChecking=no -i " + _environ.get(
"SSH_KEY" "SSH_KEY"
) )