revert: keep v0

This commit is contained in:
naiba 2024-12-07 12:39:30 +08:00
parent fb387060a2
commit 96b254a7b1

12
.github/sync.py vendored
View File

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