diff --git a/.gitea/workflows/package-tests.yml b/.gitea/workflows/package-tests.yml index a187a283..05d5ebcb 100644 --- a/.gitea/workflows/package-tests.yml +++ b/.gitea/workflows/package-tests.yml @@ -158,9 +158,34 @@ jobs: # If all else fails, create minimal structure if [[ ! -d "repo" ]]; then echo "Creating minimal repo structure..." - if [[ -d "/opt/aitbc/packages/py" ]]; then + + # Try multiple source locations for packages + PACKAGE_SOURCES=( + "/opt/aitbc/packages/py" + "/opt/aitbc/packages" + "/opt/aitbc" + ) + + PACKAGES_FOUND="" + for source in "${PACKAGE_SOURCES[@]}"; do + if [[ -d "$source" ]]; then + echo "Found packages at: $source" + PACKAGES_FOUND="$source" + break + fi + done + + if [[ -n "$PACKAGES_FOUND" ]]; then mkdir -p repo - cp -r /opt/aitbc/packages/py repo/ + if [[ "$PACKAGES_FOUND" == "/opt/aitbc/packages/py" ]]; then + cp -r /opt/aitbc/packages/py repo/ + elif [[ "$PACKAGES_FOUND" == "/opt/aitbc/packages" ]]; then + cp -r /opt/aitbc/packages repo/ + else + # Copy entire directory structure + cp -r /opt/aitbc/* repo/ 2>/dev/null || true + fi + cd repo git init git config --global http.sslVerify false @@ -170,10 +195,34 @@ jobs: git commit -m "Initial commit for CI" 2>/dev/null || true cd .. else - echo "❌ No packages/py directory found" - echo "Available in /opt/aitbc:" - ls -la /opt/aitbc/ | head -10 - exit 1 + echo "❌ No packages directory found in any location" + echo "Creating minimal package structure..." + mkdir -p repo/packages/py + + # Create minimal package directories for testing + for pkg in aitbc-core aitbc-crypto aitbc-sdk aitbc-agent-sdk; do + mkdir -p "repo/packages/py/$pkg" + cat > "repo/packages/py/$pkg/pyproject.toml" << EOF +[tool.poetry] +name = "$pkg" +version = "0.1.0" +description = "Test package for CI" +authors = ["AITBC Team"] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" +EOF + done + + cd repo + git init + git config --global http.sslVerify false + git config --global http.postBuffer 1048576000 + git remote add origin "$REPO_URL" + git add . + git commit -m "Initial commit for CI" 2>/dev/null || true + cd .. fi fi fi