fix(ci): clone repo locally and zip with python zipfile
Some checks failed
release / release (push) Failing after 0s
Some checks failed
release / release (push) Failing after 0s
Clone from Gitea in-runner instead of actions/checkout; build media-assets.zip via stdlib zipfile. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,16 +15,47 @@ jobs:
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
- 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
|
||||
working-directory: repo
|
||||
run: |
|
||||
rm -rf dist
|
||||
mkdir -p dist/media-assets
|
||||
cp README.md manifest.json dist/media-assets/
|
||||
cp -r music fonts watermark dist/media-assets/
|
||||
cd dist
|
||||
zip -r media-assets.zip media-assets
|
||||
|
||||
cp -R README.md dist/media-assets/
|
||||
cp -R manifest.json dist/media-assets/
|
||||
cp -R music dist/media-assets/
|
||||
cp -R fonts dist/media-assets/
|
||||
cp -R watermark dist/media-assets/
|
||||
|
||||
python3 - <<'PY'
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
|
||||
root = Path("dist/media-assets")
|
||||
out = Path("dist/media-assets.zip")
|
||||
if out.exists():
|
||||
out.unlink()
|
||||
|
||||
with ZipFile(out, "w", ZIP_DEFLATED) as zf:
|
||||
for path in root.rglob("*"):
|
||||
if path.is_file():
|
||||
zf.write(path, path.relative_to("dist"))
|
||||
|
||||
print(f"created {out} size={out.stat().st_size}")
|
||||
PY
|
||||
|
||||
ls -lh dist
|
||||
|
||||
- name: Publish stable release asset
|
||||
working-directory: repo
|
||||
env:
|
||||
GITEA_SERVER_URL: https://git.jc2009.com
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user