mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-27 23:47:39 +01:00
CI: improve more ci worflow
This commit is contained in:
6
.github/workflows/nightly.yml
vendored
6
.github/workflows/nightly.yml
vendored
@@ -153,7 +153,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 scripts/ci/workflow.py deploy \
|
python3 scripts/ci/workflow.py deploy \
|
||||||
Dependencies/apps-v2.json \
|
Dependencies/apps-v2.json \
|
||||||
|
"_includes/source.json" \
|
||||||
nightly \
|
nightly \
|
||||||
"$SHORT_COMMIT" \
|
"$SHORT_COMMIT" \
|
||||||
"$MARKETING_VERSION" \
|
"$MARKETING_VERSION" \
|
||||||
"$VERSION"
|
"$VERSION" \
|
||||||
|
"${{ github.ref_name }}" \
|
||||||
|
"com.SideStore.SideStore" \
|
||||||
|
"SideStore.ipa"
|
||||||
@@ -228,45 +228,52 @@ def release_notes(tag):
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# DEPLOY SOURCE.JSON
|
# DEPLOY SOURCE.JSON
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
def deploy(repo, source_json, release_tag, short_commit, marketing_version, version, channel, bundle_id, ipa_name):
|
||||||
def deploy(repo, release_tag, short_commit, marketing_version, version):
|
|
||||||
repo = Path(repo).resolve()
|
repo = Path(repo).resolve()
|
||||||
|
ipa_path = ROOT / ipa_name
|
||||||
|
|
||||||
if not repo.exists():
|
if not repo.exists():
|
||||||
raise SystemExit(f"{repo} repo missing")
|
raise SystemExit(f"{repo} repo missing")
|
||||||
|
|
||||||
run(
|
if not ipa_path.exists():
|
||||||
f"python3 generate_source_metadata.py "
|
raise SystemExit(f"{ipa_path} missing")
|
||||||
f"--repo-root {ROOT} "
|
|
||||||
f"--ipa {ROOT}/SideStore.ipa "
|
|
||||||
f"--output-dir {repo} "
|
|
||||||
f"--release-notes-dir {repo} "
|
|
||||||
f"--release-tag {release_tag} "
|
|
||||||
f"--version {version} "
|
|
||||||
f"--marketing-version {marketing_version} "
|
|
||||||
f"--short-commit {short_commit} "
|
|
||||||
f"--release-channel nightly "
|
|
||||||
f"--bundle-id com.SideStore.SideStore"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
run(f"pushd {repo}", check=True)
|
||||||
try:
|
try:
|
||||||
run("git config user.name 'GitHub Actions'", check=False, cwd=repo)
|
# source_json is RELATIVE to repo
|
||||||
run("git config user.email 'github-actions@github.com'", check=False, cwd=repo)
|
if not Path(source_json).exists():
|
||||||
|
raise SystemExit(f"{source_json} missing inside repo")
|
||||||
|
|
||||||
run(
|
run(
|
||||||
"python3 ../../scripts/update_source_metadata.py './_includes/source.json'",
|
f"python3 {ROOT}/generate_source_metadata.py "
|
||||||
cwd=repo,
|
f"--repo-root {ROOT} "
|
||||||
|
f"--ipa {ipa_path} "
|
||||||
|
f"--output-dir . "
|
||||||
|
f"--release-notes-dir . "
|
||||||
|
f"--release-tag {release_tag} "
|
||||||
|
f"--version {version} "
|
||||||
|
f"--marketing-version {marketing_version} "
|
||||||
|
f"--short-commit {short_commit} "
|
||||||
|
f"--release-channel {channel} "
|
||||||
|
f"--bundle-id {bundle_id}"
|
||||||
)
|
)
|
||||||
|
|
||||||
run("git add --verbose ./_includes/source.json", check=False, cwd=repo)
|
run("git config user.name 'GitHub Actions'", check=False)
|
||||||
|
run("git config user.email 'github-actions@github.com'", check=False)
|
||||||
|
|
||||||
run(
|
run(
|
||||||
f"git commit -m ' - updated for {short_commit} deployment' || true",
|
f"python3 {ROOT}/scripts/update_source_metadata.py '{source_json}'"
|
||||||
|
)
|
||||||
|
|
||||||
|
run(f"git add --verbose {source_json}", check=False)
|
||||||
|
run(
|
||||||
|
f"git commit -m '{release_tag} - deployed {version}' || true",
|
||||||
check=False,
|
check=False,
|
||||||
cwd=repo,
|
|
||||||
)
|
)
|
||||||
run("git push --verbose", check=False, cwd=repo)
|
run("git push --verbose", check=False)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
pass
|
run("popd", check=False)
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# ENTRYPOINT
|
# ENTRYPOINT
|
||||||
@@ -281,8 +288,7 @@ COMMANDS = {
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# VERSION / MARKETING
|
# VERSION / MARKETING
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"bump-beta" : (bump_beta, 0, ""),
|
"get-marketing-version" : (set_marketing_version, 1, "<qualified_version>"),
|
||||||
"version" : (get_marketing_version, 0, ""),
|
|
||||||
"set-marketing-version" : (set_marketing_version, 1, "<qualified_version>"),
|
"set-marketing-version" : (set_marketing_version, 1, "<qualified_version>"),
|
||||||
"compute-qualified" : (compute_qualified_version, 4, "<marketing> <build_num> <channel> <short_commit>"),
|
"compute-qualified" : (compute_qualified_version, 4, "<marketing> <build_num> <channel> <short_commit>"),
|
||||||
"reserve_build_number" : (reserve_build_number, 1, "<repo>"),
|
"reserve_build_number" : (reserve_build_number, 1, "<repo>"),
|
||||||
@@ -305,7 +311,7 @@ COMMANDS = {
|
|||||||
"tests-build" : (tests_build, 0, ""),
|
"tests-build" : (tests_build, 0, ""),
|
||||||
"tests-run" : (tests_run, 1, "<model>"),
|
"tests-run" : (tests_run, 1, "<model>"),
|
||||||
"boot-sim-async" : (boot_sim_async, 1, "<model>"),
|
"boot-sim-async" : (boot_sim_async, 1, "<model>"),
|
||||||
"boot-sim-sync" : (boot_sim_sync, 0, ""),
|
"boot-sim-sync" : (boot_sim_sync, 1, "<model>"),
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# LOG ENCRYPTION
|
# LOG ENCRYPTION
|
||||||
@@ -318,7 +324,7 @@ COMMANDS = {
|
|||||||
# RELEASE / DEPLOY
|
# RELEASE / DEPLOY
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"release-notes" : (release_notes, 1, "<tag>"),
|
"release-notes" : (release_notes, 1, "<tag>"),
|
||||||
"deploy" : (deploy, 5, "<repo> <release_tag> <short_commit> <marketing_version> <version>"),
|
"deploy" : (deploy, 9, "<repo> <source_json> <release_tag> <short_commit> <marketing_version> <version> <channel> <bundle_id> <ipa_name>"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Reference in New Issue
Block a user