Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| edaac8aa45 |
27
.github/workflows/release_skill.yaml
vendored
27
.github/workflows/release_skill.yaml
vendored
@@ -108,4 +108,31 @@ jobs:
|
||||
exit(1)
|
||||
if payload.get('code') != 200:
|
||||
exit(1)
|
||||
"
|
||||
|
||||
# 7. 清理旧版本(只保留最新1个)
|
||||
- name: Prune Old Versions
|
||||
env:
|
||||
SLUG: ${{ steps.build_task.outputs.slug }}
|
||||
VERSION: ${{ steps.build_task.outputs.version }}
|
||||
run: |
|
||||
python -c "
|
||||
import requests, os
|
||||
url = 'https://jc2009.com/api/artifacts/prune-old-versions'
|
||||
payload = {
|
||||
'name': os.environ['SLUG'],
|
||||
'artifact_type': 'skill',
|
||||
'keep_count': 1,
|
||||
'protect_version': os.environ['VERSION']
|
||||
}
|
||||
res = requests.post(url, json=payload)
|
||||
print(f'Prune Result: {res.text}')
|
||||
if res.status_code != 200:
|
||||
exit(1)
|
||||
try:
|
||||
body = res.json()
|
||||
except Exception:
|
||||
exit(1)
|
||||
if body.get('code') != 200:
|
||||
exit(1)
|
||||
"
|
||||
Reference in New Issue
Block a user