Skip to content

Commit

Permalink
[CI] Add init module version (#7388)
Browse files Browse the repository at this point in the history
* add init module versionb
  • Loading branch information
AllyW committed Mar 18, 2024
1 parent 341caad commit fa85faa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/ci/release_version_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
pr_label_list = [name.lower() for name in pr_label_list]

DEFAULT_VERSION = "0.0.0"
INIT_RELEASE_VERSION = "1.0.0b1"


def get_module_metadata_of_max_version(mod):
Expand Down Expand Up @@ -70,7 +71,7 @@ def gen_comment_message(mod, next_version, comment_message):
comment_message.append("### Module: {0}".format(mod))
comment_message.append(" - Update version to `{0}` in setup.py".format(next_version.get("version", "-")))
if next_version.get("has_preview_tag", False):
comment_message.append(' - Set `azext.isPreview` to `true` in azext_{0}/azext_metadata.json'.format(mod))
comment_message.append(' - Set `azext.isPreview` to `true` in azext_{0}/azext_metadata.json if not exists'.format(mod))


def add_label_hint_message(comment_message):
Expand Down Expand Up @@ -112,10 +113,14 @@ def main():
for mod in changed_module_list:
base_meta_file = os.path.join(cli_ext_path, base_meta_path, "az_" + mod + "_meta.json")
diff_meta_file = os.path.join(cli_ext_path, diff_meta_path, "az_" + mod + "_meta.json")
if not os.path.exists(base_meta_file):
if not os.path.exists(base_meta_file) and not os.path.exists(diff_meta_file):
print("no base and diff meta file found for {0}".format(mod))
continue
elif not os.path.exists(base_meta_file) and os.path.exists(diff_meta_file):
print("no base meta file found for {0}".format(mod))
gen_comment_message(mod, {"version": INIT_RELEASE_VERSION}, comment_message)
continue
if not os.path.exists(diff_meta_file):
elif not os.path.exists(diff_meta_file):
print("no diff meta file found for {0}".format(mod))
continue

Expand Down

0 comments on commit fa85faa

Please sign in to comment.