From 1e1ef7cb8a122b64c9a62229a1b7d7189ca7300f Mon Sep 17 00:00:00 2001 From: Michael Hollister Date: Mon, 21 Oct 2024 14:51:03 -0500 Subject: [PATCH] rename to rc only for current versions --- receivers/electron/scripts/deploy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/receivers/electron/scripts/deploy.py b/receivers/electron/scripts/deploy.py index b4a8c15..3496934 100644 --- a/receivers/electron/scripts/deploy.py +++ b/receivers/electron/scripts/deploy.py @@ -96,7 +96,7 @@ def sync_local_cache(): with open(save_path, 'wb') as file: file.write(get_response['Body'].read()) -def upload_local_cache(): +def upload_local_cache(current_version): print('Uploading local cache to s3...') shutil.copytree(TEMP_DIR, os.path.join(LOCAL_CACHE_DIR, 'electron'), dirs_exist_ok=True) @@ -104,8 +104,9 @@ def upload_local_cache(): for root, _, files in os.walk(LOCAL_CACHE_DIR): for filename in files: rel_path = os.path.relpath(os.path.join(root, filename), LOCAL_CACHE_DIR) + version = rel_path.split('/')[1] - if RELEASE_CANDIDATE: + if RELEASE_CANDIDATE and version == current_version: rc_path = rel_path[:rel_path.rfind('.')] + f'_rc{RELEASE_CANDIDATE_VERSION}' + rel_path[rel_path.rfind('.'):] os.rename(rel_path, rc_path) rel_path = rc_path @@ -137,7 +138,7 @@ def update_website(): current_version = copy_artifacts_to_local_cache() sync_local_cache() # generate_delta_updates(current_version) -upload_local_cache() +upload_local_cache(current_version) # generate_previous_releases_page() # update_website()