105 lines
4.7 KiB
YAML
105 lines
4.7 KiB
YAML
name: EcoArk Wheel Pipeline CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
# Uncomment the line below to trigger releases on tags:
|
|
# tags: ['v*']
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
|
|
# ──────────────────────────────────────────────────────
|
|
# Job: build — validate core logic + manifest-driven
|
|
# rebuild (stub) + zip bundle
|
|
# ──────────────────────────────────────────────────────
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
run: |
|
|
git init
|
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
|
git fetch --depth 1 origin "${GITHUB_SHA}"
|
|
git checkout "${GITHUB_SHA}"
|
|
|
|
- name: Show environment info
|
|
run: |
|
|
echo "╔══════════════════════════════════════════╗"
|
|
echo "║ EcoArk Wheel Pipeline CI ║"
|
|
echo "╚══════════════════════════════════════════╝"
|
|
echo " Runner : $(uname -a)"
|
|
echo " Hostname: $(hostname)"
|
|
echo " Date : $(date -u +%Y%m%dT%H%M%SZ)"
|
|
python3 --version
|
|
pip3 --version 2>/dev/null || echo "pip3 not available"
|
|
which make git 2>/dev/null || true
|
|
|
|
- name: Install Python build deps
|
|
run: |
|
|
pip3 install --quiet --upgrade pip setuptools wheel 2>/dev/null || true
|
|
|
|
# ── Validate single-wheel mode (backward-compat) ──
|
|
- name: Generate test wheels
|
|
run: python3 examples/gen_test_wheels.py
|
|
|
|
- name: Validate pure wheel repack
|
|
run: |
|
|
WHEEL=$(ls examples/*-none-any.whl | head -1)
|
|
python3 wheel_pipeline.py "$WHEEL" --output-dir output
|
|
|
|
- name: Validate native wheel stub
|
|
run: |
|
|
WHEEL=$(ls examples/*-manylinux*.whl | head -1)
|
|
python3 wheel_pipeline.py "$WHEEL" --output-dir output --target-os harmonyos --arch arm64
|
|
|
|
# ── Validate manifest-driven mode ─────────────────
|
|
- name: Run manifest pipeline (default packages.txt)
|
|
run: |
|
|
python3 wheel_pipeline.py --manifest packages.txt \
|
|
--output-dir output --target-os harmonyos --arch arm64
|
|
|
|
- name: Run manifest pipeline (test manifest with fake entry)
|
|
run: |
|
|
echo "# test manifest" > output/test_packages.txt
|
|
echo "numpy:https://github.com/numpy/numpy.git" >> output/test_packages.txt
|
|
python3 wheel_pipeline.py --manifest output/test_packages.txt \
|
|
--output-dir output --target-os harmonyos --arch arm64
|
|
|
|
- name: List all pipeline outputs
|
|
run: |
|
|
echo "=== Output tree ==="
|
|
find output/ -type f | sort
|
|
echo ""
|
|
echo "=== Zip bundle ==="
|
|
ls -lh output/ecoark-rebuild-output.zip 2>/dev/null || echo "(no zip)"
|
|
|
|
# ── Upload total bundle as CI artifact (Gitea-native) ──
|
|
- name: Upload bundle as artifact
|
|
run: python3 scripts/upload_artifacts.py ecoark-harmonyos-wheels "output/ecoark-rebuild-output.zip"
|
|
|
|
# ── Upload each .whl individually as artifact ─────────
|
|
- name: Upload individual wheel artifacts
|
|
run: python3 scripts/upload_artifacts.py ecoark-wheels-individual "output/*.whl" "output/wheels/*.whl"
|
|
|
|
# ──────────────────────────────────────────────────────
|
|
# Publish to Gitea Release (optional — requires secrets)
|
|
# ──────────────────────────────────────────────────────
|
|
- name: Upload assets to Gitea Release
|
|
if: secrets.GITEA_TOKEN != '' && secrets.ENABLE_RELEASE_UPLOAD == 'true'
|
|
run: python3 scripts/upload_release_assets.py output/
|
|
env:
|
|
ENABLE_RELEASE_UPLOAD: 'true'
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "All pipeline steps passed successfully."
|
|
echo "Artifacts:"
|
|
echo " - ecoark-harmonyos-wheels (total zip bundle)"
|
|
echo " - ecoark-wheels-individual (each .whl file individually)"
|
|
echo "Release upload: configured via GITEA_TOKEN + ENABLE_RELEASE_UPLOAD secrets"
|