From 96b254a7b1b2485315940f222ba0d62a3d09036e Mon Sep 17 00:00:00 2001 From: naiba Date: Sat, 7 Dec 2024 12:39:30 +0800 Subject: [PATCH] revert: keep v0 --- .github/sync.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/sync.py b/.github/sync.py index 07292d6c13..9d45183338 100644 --- a/.github/sync.py +++ b/.github/sync.py @@ -52,10 +52,7 @@ def delete_gitee_releases(latest_id, client, uri, token): print(f'Current release ids: {release_ids}') release_ids.remove(latest_id) - # 2024.12.01 保留 v0 开头的 Release for id in release_ids: - if id.startswith('v0'): - continue release_uri = f"{uri}/{id}" delete_data = { 'access_token': token @@ -97,12 +94,6 @@ def sync_to_gitee(tag: str, body: str, files: slice): f"Request failed with status code {release_api_response.status_code}") print(f"Gitee release id: {release_id}") - - # 仅保留最新 Release 以防超出 Gitee 仓库配额 - try: - delete_gitee_releases(release_id, api_client, - release_api_uri, access_token) - asset_api_uri = f"{release_api_uri}/{release_id}/attach_files" for file_path in files: @@ -125,6 +116,9 @@ def sync_to_gitee(tag: str, body: str, files: slice): print( f"Request failed with status code {asset_api_response.status_code}") + # 仅保留最新 Release 以防超出 Gitee 仓库配额 + try: + delete_gitee_releases(release_id, api_client, release_api_uri, access_token) except ValueError as e: print(e)