fix: improve artifact publishing and build diagnostics

This commit is contained in:
CyberMind-FR 2025-12-23 18:29:51 +01:00
parent 60d1637a5d
commit 60f2ffde67

View File

@ -325,6 +325,7 @@ jobs:
BUILT=0 BUILT=0
FAILED=0 FAILED=0
BUILT_LIST="" BUILT_LIST=""
FAILED_LIST=""
for pkg in package/luci-app-*/; do for pkg in package/luci-app-*/; do
[[ -d "$pkg" ]] || continue [[ -d "$pkg" ]] || continue
@ -335,8 +336,19 @@ jobs:
echo "📦 Building: $PKG_NAME" echo "📦 Building: $PKG_NAME"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Show package contents for debugging
echo "📁 Package contents:"
ls -la "$pkg"
# Verify Makefile syntax
if ! grep -q "BuildPackage" "${pkg}Makefile"; then
echo "⚠️ WARNING: Makefile missing BuildPackage call"
fi
# Build with timeout (10 minutes per package) # Build with timeout (10 minutes per package)
if timeout 600 make package/${PKG_NAME}/compile V=s -j$(nproc) 2>&1 | tail -100; then BUILD_LOG="/tmp/build-${PKG_NAME}.log"
if timeout 600 make package/${PKG_NAME}/compile V=s -j$(nproc) > "$BUILD_LOG" 2>&1; then
# Check if .ipk was created # Check if .ipk was created
IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1) IPK_FILE=$(find bin -name "${PKG_NAME}*.ipk" 2>/dev/null | head -1)
@ -347,11 +359,17 @@ jobs:
BUILT_LIST="${BUILT_LIST}${PKG_NAME}," BUILT_LIST="${BUILT_LIST}${PKG_NAME},"
else else
echo "⚠️ No .ipk generated for $PKG_NAME" echo "⚠️ No .ipk generated for $PKG_NAME"
echo "📋 Last 50 lines of build log:"
tail -50 "$BUILD_LOG"
FAILED=$((FAILED + 1)) FAILED=$((FAILED + 1))
FAILED_LIST="${FAILED_LIST}${PKG_NAME},"
fi fi
else else
echo "❌ Failed: $PKG_NAME" echo "❌ Build failed: $PKG_NAME"
echo "📋 Last 100 lines of build log:"
tail -100 "$BUILD_LOG"
FAILED=$((FAILED + 1)) FAILED=$((FAILED + 1))
FAILED_LIST="${FAILED_LIST}${PKG_NAME},"
fi fi
echo "" echo ""
@ -363,7 +381,10 @@ jobs:
echo "✅ Built: $BUILT packages" echo "✅ Built: $BUILT packages"
echo "❌ Failed: $FAILED packages" echo "❌ Failed: $FAILED packages"
echo "" echo ""
echo "Packages: $BUILT_LIST" echo "Built: $BUILT_LIST"
if [[ -n "$FAILED_LIST" ]]; then
echo "Failed: $FAILED_LIST"
fi
- name: Collect artifacts - name: Collect artifacts
id: collect id: collect
@ -426,88 +447,160 @@ jobs:
fi fi
# ============================================ # ============================================
# Create release # Publish combined artifacts (always)
# ============================================ # ============================================
release: publish-artifacts:
needs: [setup, build] needs: [setup, build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') if: always() && needs.build.result == 'success'
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts - name: Download all artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: packages path: packages
pattern: packages-* pattern: packages-*
- name: Organize release - name: Create combined archives
run: | run: |
VERSION="${{ needs.setup.outputs.version }}" VERSION="${{ needs.setup.outputs.version }}"
mkdir -p release mkdir -p release
echo "📁 Organizing release..." echo "📁 Creating combined archives..."
# Per-architecture archives
for dir in packages/packages-*/; do for dir in packages/packages-*/; do
[[ -d "$dir" ]] || continue [[ -d "$dir" ]] || continue
ARCH=$(basename "$dir" | sed 's/packages-//') ARCH=$(basename "$dir" | sed 's/packages-//')
echo "📦 $ARCH" echo "📦 $ARCH"
tar -czf "release/secubox-${VERSION}-${ARCH}.tar.gz" -C "$dir" . # Copy .ipk files to release
mkdir -p "release/${ARCH}"
cp "$dir"/*.ipk "release/${ARCH}/" 2>/dev/null || true
# Create archive
if ls "release/${ARCH}"/*.ipk >/dev/null 2>&1; then
tar -czf "release/secubox-${VERSION}-${ARCH}.tar.gz" -C "release/${ARCH}" .
fi
done done
# Create all-in-one archive # Create all-in-one archive
tar -czf "release/secubox-${VERSION}-all.tar.gz" -C packages . tar -czf "release/secubox-${VERSION}-all-architectures.tar.gz" -C packages .
# Checksums # Checksums
cd release cd release
sha256sum *.tar.gz > SHA256SUMS sha256sum *.tar.gz > SHA256SUMS 2>/dev/null || true
echo "📋 Release:" echo ""
echo "📋 Release contents:"
ls -la ls -la
echo ""
echo "📊 Package count per architecture:"
for dir in */; do
[[ -d "$dir" ]] || continue
COUNT=$(ls "$dir"/*.ipk 2>/dev/null | wc -l)
echo " ${dir%/}: $COUNT packages"
done
- name: Upload combined release
uses: actions/upload-artifact@v4
with:
name: secubox-release-${{ needs.setup.outputs.version }}
path: |
release/*.tar.gz
release/SHA256SUMS
retention-days: 90
- name: Upload individual .ipk files
uses: actions/upload-artifact@v4
with:
name: secubox-all-ipk-${{ needs.setup.outputs.version }}
path: release/*/*.ipk
retention-days: 90
# ============================================
# Create GitHub Release (on tags or manual)
# ============================================
release:
needs: [setup, build, publish-artifacts]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download release artifact
uses: actions/download-artifact@v4
with:
name: secubox-release-${{ needs.setup.outputs.version }}
path: release
- name: Download all .ipk files
uses: actions/download-artifact@v4
with:
name: secubox-all-ipk-${{ needs.setup.outputs.version }}
path: ipk-files
continue-on-error: true
- name: List packages
id: list-packages
run: |
echo "📦 Packages in release:"
find . -name "*.ipk" -exec basename {} \; | sort -u
# Count unique packages
PKG_LIST=$(find . -name "*.ipk" -exec basename {} \; | sort -u | sed 's/_[0-9].*//g' | sort -u | tr '\n' ', ' | sed 's/,$//')
echo "packages=$PKG_LIST" >> $GITHUB_OUTPUT
- name: Create GitHub Release - name: Create GitHub Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
name: SecuBox ${{ needs.setup.outputs.version }} name: SecuBox ${{ needs.setup.outputs.version }}
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', needs.setup.outputs.version) }}
body: | body: |
## SecuBox Packages v${{ needs.setup.outputs.version }} ## 📦 SecuBox Packages v${{ needs.setup.outputs.version }}
Pre-built LuCI packages for OpenWrt ${{ env.OPENWRT_VERSION }}. Pre-built LuCI packages for OpenWrt ${{ env.OPENWRT_VERSION }}.
### 📦 Included Modules ### ✅ Built Packages
- luci-app-secubox - Central Hub ${{ steps.list-packages.outputs.packages }}
- luci-app-crowdsec-dashboard
- luci-app-netdata-dashboard
- luci-app-netifyd-dashboard
- luci-app-wireguard-dashboard
- luci-app-network-modes
- luci-app-client-guardian
- luci-app-bandwidth-manager
- luci-app-auth-guardian
- luci-app-media-flow
- luci-app-vhost-manager
### 📥 Installation ### 📥 Installation
```bash ```bash
# Upload .ipk to router, then: # Download the archive for your architecture
# Extract and upload .ipk files to router
opkg update opkg update
opkg install /tmp/luci-app-secubox_*.ipk opkg install /tmp/luci-app-*.ipk
# Restart services
/etc/init.d/rpcd restart
``` ```
### 🏗️ Supported Architectures
- `x86-64` - PC, VMs, Proxmox
- `aarch64-cortex-a72` - MOCHAbin, RPi4
- `aarch64-cortex-a53` - ESPRESSObin
- `aarch64-generic` - Generic ARM64
- `mips-24kc` - TP-Link, ath79
- `mipsel-24kc` - Xiaomi, GL.iNet
- `mediatek-filogic` - MT7981/MT7986
### 🔗 Links ### 🔗 Links
- [Website](https://secubox.cybermood.eu) - [SecuBox Website](https://secubox.cybermood.eu)
- [Documentation](https://cybermind.fr/docs/secubox) - [CyberMind.fr](https://cybermind.fr)
files: | files: |
release/*.tar.gz release/*.tar.gz
release/SHA256SUMS release/SHA256SUMS
draft: false draft: false
prerelease: ${{ github.event_name == 'workflow_dispatch' }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}