fix(ci): use gitea mirror checkout and python3.12 zip publish
All checks were successful
release / release (push) Successful in 3s

Replace manual git clone with admin/actions-checkout@v4 from Gitea mirror.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 15:13:24 +08:00
parent 5346eff658
commit 83d444b1c2

View File

@@ -9,23 +9,25 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
GITEA_SERVER_URL: https://git.jc2009.com
GITEA_REPOSITORY: client-commons/media-assets
GITEA_SHA: ${{ github.sha }}
steps: steps:
- name: Checkout
uses: https://git.jc2009.com/admin/actions-checkout@v4
- name: Show workspace - name: Show workspace
run: | run: |
pwd pwd
ls -la ls -la
find . -maxdepth 2 -type f | sort | head -80
- name: Clone repository
run: |
rm -rf repo
git clone --depth 1 "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" repo
cd repo
git rev-parse HEAD
ls -la
- name: Build stable zip - name: Build stable zip
working-directory: repo
run: | run: |
set -e
rm -rf dist rm -rf dist
mkdir -p dist/media-assets mkdir -p dist/media-assets
@@ -35,34 +37,33 @@ jobs:
cp -R fonts dist/media-assets/ cp -R fonts dist/media-assets/
cp -R watermark dist/media-assets/ cp -R watermark dist/media-assets/
python3 - <<'PY' python3.12 - <<'PY'
from pathlib import Path from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED from zipfile import ZipFile, ZIP_DEFLATED
root = Path("dist/media-assets") root = Path("dist/media-assets")
out = Path("dist/media-assets.zip") out = Path("dist/media-assets.zip")
if out.exists(): if out.exists():
out.unlink() out.unlink()
with ZipFile(out, "w", ZIP_DEFLATED) as zf: with ZipFile(out, "w", ZIP_DEFLATED) as zf:
for path in root.rglob("*"): for path in sorted(root.rglob("*")):
if path.is_file(): if path.is_file():
zf.write(path, path.relative_to("dist")) zf.write(path, path.relative_to("dist"))
print(f"created {out} size={out.stat().st_size}") print("created {} size={}".format(out, out.stat().st_size))
PY PY
ls -lh dist ls -lh dist/media-assets.zip
- name: Publish stable release asset - name: Publish stable release asset
working-directory: repo
env: env:
GITEA_SERVER_URL: https://git.jc2009.com
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_REPOSITORY: client-commons/media-assets
GITEA_SHA: ${{ github.sha }}
run: | run: |
python3 scripts/publish_gitea_release_asset.py \ set -e
python3.12 scripts/publish_gitea_release_asset.py \
--tag vlatest \ --tag vlatest \
--title "media-assets latest" \ --title "media-assets latest" \
--file dist/media-assets.zip \ --file dist/media-assets.zip \