Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: make bump optional #50

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps_ci/scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ def update_app_version(app_path: str, bump_type: str, dep_name: str, dep_version
with open(str(app_metadata_file), 'r') as f:
app_config = yaml.safe_load(f.read())

old_version = app_config['version']
app_config['version'] = bump_version(old_version, bump_type)
msg = ''
if dep_name and dep_version and is_main_dep(app_dir, dep_name):
app_config['app_version'] = dep_version
rename_versioned_dir(old_version, app_config['version'], app_dir.parent.name, app_dir)
msg += f', set app_version to {dep_version!r}'
if bump_type:
old_version = app_config['version']
app_config['version'] = bump_version(old_version, bump_type)
rename_versioned_dir(old_version, app_config['version'], app_dir.parent.name, app_dir)
msg += f' and bumped version from {old_version!r} to {app_config["version"]!r}'

with open(str(app_metadata_file), 'w') as f:
f.write(yaml.safe_dump(app_config))

print(
f'[\033[92mOK\x1B[0m]\tUpdated app {app_dir.name!r} version from {old_version!r} to {app_config["version"]!r}'
)
print(f'[\033[92mOK\x1B[0m]\tUpdated app {app_dir.name!r}' + msg)


def main():
Expand Down
2 changes: 1 addition & 1 deletion apps_ci/version_bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def map_renovate_bump_type(bump: str) -> str:
return bump if bump in ('patch', 'minor', 'major') else 'patch'
return bump if bump in ('patch', 'minor', 'major', '') else 'patch'


def is_valid_version(version: str) -> bool:
Expand Down
Loading