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>
84 lines
2.1 KiB
YAML
84 lines
2.1 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
GITEA_SERVER_URL: https://git.jc2009.com
|
|
GITEA_REPOSITORY: client-commons/media-assets
|
|
GITEA_SHA: ${{ github.sha }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://git.jc2009.com/admin/actions-checkout@v4
|
|
|
|
- name: Pull Git LFS
|
|
run: |
|
|
set -e
|
|
|
|
git lfs install
|
|
git lfs pull
|
|
|
|
echo "Music files after git lfs pull:"
|
|
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
|
|
run: |
|
|
pwd
|
|
ls -la
|
|
find . -maxdepth 2 -type f | sort | head -80
|
|
|
|
- name: Build stable zip
|
|
run: |
|
|
set -e
|
|
|
|
rm -rf dist
|
|
mkdir -p dist/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.12 - <<'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 sorted(root.rglob("*")):
|
|
if path.is_file():
|
|
zf.write(path, path.relative_to("dist"))
|
|
|
|
print("created {} size={}".format(out, out.stat().st_size))
|
|
PY
|
|
|
|
ls -lh dist/media-assets.zip
|
|
|
|
- name: Publish stable release asset
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
set -e
|
|
|
|
python3.12 scripts/publish_gitea_release_asset.py \
|
|
--tag vlatest \
|
|
--title "media-assets latest" \
|
|
--file dist/media-assets.zip \
|
|
--asset-name media-assets.zip
|