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()