Skip to content

Commit

Permalink
revert: keep v0
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Dec 7, 2024
1 parent fb38706 commit 96b254a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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)

Expand Down

0 comments on commit 96b254a

Please sign in to comment.