CI: improve more ci worflow

This commit is contained in:
mahee96
2026-02-24 03:21:19 +05:30
parent ae1bd49a99
commit f8c4c558f6

View File

@@ -255,7 +255,7 @@ def release_notes(tag):
def deploy(repo, source_json, release_tag, short_commit, marketing_version, version, channel, bundle_id, ipa_name):
repo = (ROOT / repo).resolve()
ipa_path = ROOT / ipa_name
source_path = repo / source_json
if not repo.exists():
raise SystemExit(f"{repo} repo missing")
@@ -263,13 +263,6 @@ def deploy(repo, source_json, release_tag, short_commit, marketing_version, vers
if not ipa_path.exists():
raise SystemExit(f"{ipa_path} missing")
pushed = False
if Path.cwd().resolve() != repo:
run(f"pushd {repo}", check=True)
pushed = True
try:
source_path = repo / source_json
if not source_path.exists():
raise SystemExit(f"{source_json} missing inside repo")
@@ -290,12 +283,11 @@ def deploy(repo, source_json, release_tag, short_commit, marketing_version, vers
run("git config user.name 'GitHub Actions'", check=False)
run("git config user.email 'github-actions@github.com'", check=False)
run(f"python3 {ROOT}/scripts/update_source_metadata.py '{source_json}'")
max_attempts = 5
for attempt in range(1, max_attempts + 1):
run("git fetch --depth=1 origin HEAD", check=False)
run("git reset --hard FETCH_HEAD", check=False)
if attempt > 1:
run("git fetch --depth=1 origin HEAD", check=False, cwd=repo)
run("git reset --hard FETCH_HEAD", check=False, cwd=repo)
# regenerate after reset so we don't lose changes
run(f"python3 {ROOT}/scripts/update_source_metadata.py '{source_json}'")
@@ -313,9 +305,6 @@ def deploy(repo, source_json, release_tag, short_commit, marketing_version, vers
else:
raise SystemExit("Deploy push failed after retries")
finally:
if pushed: run("popd", check=False)
# ----------------------------------------------------------
# ENTRYPOINT
# ----------------------------------------------------------