3 Commits

Author SHA1 Message Date
c428afd80b fix(ci): delete release asset with release id
All checks were successful
release / release (push) Successful in 12s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 16:06:43 +08:00
3fa77f1524 fix(ci): clone repository directly for media assets bundle
Some checks failed
release / release (push) Failing after 6s
2026-06-06 15:54:52 +08:00
c0f946fd51 fix(ci): pull git lfs after checkout before building zip
Some checks failed
release / release (push) Failing after 45s
Add git lfs pull step with mp3 size/header diagnostics before packaging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-06 15:35:57 +08:00
2 changed files with 20 additions and 5 deletions

View File

@@ -15,16 +15,30 @@ jobs:
GITEA_SHA: ${{ github.sha }} GITEA_SHA: ${{ github.sha }}
steps: steps:
- name: Checkout - name: Clone repository
uses: https://git.jc2009.com/admin/actions-checkout@v4 run: |
set -e
rm -rf repo
git clone https://git.jc2009.com/client-commons/media-assets.git repo
cd repo
git rev-parse HEAD
echo "Music files after clone:"
find music -type f -name "*.mp3" -exec ls -lh {} \;
echo "MP3 file headers:"
find music -type f -name "*.mp3" -exec sh -c 'echo "---- $1"; head -c 80 "$1"; echo' _ {} \;
- name: Show workspace - name: Show workspace
working-directory: repo
run: | run: |
pwd pwd
ls -la ls -la
find . -maxdepth 2 -type f | sort | head -80 find . -maxdepth 2 -type f | sort | head -80
- name: Build stable zip - name: Build stable zip
working-directory: repo
run: | run: |
set -e set -e
@@ -58,6 +72,7 @@ jobs:
ls -lh dist/media-assets.zip ls -lh dist/media-assets.zip
- name: Publish stable release asset - name: Publish stable release asset
working-directory: repo
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |

View File

@@ -119,8 +119,8 @@ def _list_release_assets(api_base: str, token: str, release_id: int) -> list[dic
return assets return assets
def _delete_asset(api_base: str, token: str, asset_id: int) -> None: def _delete_asset(api_base: str, token: str, release_id: int, asset_id: int) -> None:
url = f"{api_base}/releases/assets/{asset_id}" url = f"{api_base}/releases/{release_id}/assets/{asset_id}"
status, body = _request("DELETE", url, token) status, body = _request("DELETE", url, token)
if status >= 400: if status >= 400:
_fail(f"failed to delete asset {asset_id}", status=status, body=body) _fail(f"failed to delete asset {asset_id}", status=status, body=body)
@@ -213,7 +213,7 @@ def main(argv: list[str] | None = None) -> int:
if asset.get("name") == args.asset_name: if asset.get("name") == args.asset_name:
asset_id = int(asset["id"]) asset_id = int(asset["id"])
print(f"Deleting existing asset {args.asset_name} (id={asset_id})...") print(f"Deleting existing asset {args.asset_name} (id={asset_id})...")
_delete_asset(api_base, token, asset_id) _delete_asset(api_base, token, release_id, asset_id)
print(f"Uploading {file_path} as {args.asset_name}...") print(f"Uploading {file_path} as {args.asset_name}...")
uploaded = _upload_asset( uploaded = _upload_asset(