single ipk build capacity

This commit is contained in:
CyberMind-FR 2025-12-23 20:54:06 +01:00
parent eb72e12a72
commit 1f6b5dc393
2 changed files with 123 additions and 35 deletions

View File

@ -9,6 +9,25 @@ on:
branches: [main, master] branches: [main, master]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
package_name:
description: 'Package to build (leave empty for all packages)'
required: false
type: choice
options:
- ''
- 'luci-app-secubox'
- '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-system-hub'
- 'luci-app-bandwidth-manager'
- 'luci-app-auth-guardian'
- 'luci-app-media-flow'
- 'luci-app-vhost-manager'
- 'luci-app-cdn-cache'
openwrt_version: openwrt_version:
description: 'OpenWrt version' description: 'OpenWrt version'
required: true required: true
@ -54,6 +73,13 @@ jobs:
echo "version=${VERSION#v}" >> $GITHUB_OUTPUT echo "version=${VERSION#v}" >> $GITHUB_OUTPUT
echo "📦 Package version: ${VERSION#v}" echo "📦 Package version: ${VERSION#v}"
PACKAGE_NAME="${{ github.event.inputs.package_name }}"
if [[ -n "$PACKAGE_NAME" ]]; then
echo "🎯 Building single package: $PACKAGE_NAME"
else
echo "📦 Building all packages"
fi
- name: Set build matrix - name: Set build matrix
id: set-matrix id: set-matrix
run: | run: |
@ -281,20 +307,38 @@ jobs:
- name: Copy packages to SDK - name: Copy packages to SDK
run: | run: |
VERSION="${{ needs.setup.outputs.version }}" VERSION="${{ needs.setup.outputs.version }}"
echo "📦 Copying packages (version: $VERSION)..." PACKAGE_NAME="${{ github.event.inputs.package_name }}"
for pkg in luci-app-*/; do if [[ -n "$PACKAGE_NAME" ]]; then
if [[ -d "$pkg" && -f "${pkg}Makefile" ]]; then echo "📦 Copying single package: $PACKAGE_NAME (version: $VERSION)..."
PKG_NAME=$(basename "$pkg")
echo " 📁 $PKG_NAME" if [[ -d "$PACKAGE_NAME" && -f "${PACKAGE_NAME}/Makefile" ]]; then
cp -r "$pkg" sdk/package/ echo " 📁 $PACKAGE_NAME"
cp -r "$PACKAGE_NAME" sdk/package/
# Update version # Update version
sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=$VERSION/" "sdk/package/${PKG_NAME}/Makefile" sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=$VERSION/" "sdk/package/${PACKAGE_NAME}/Makefile"
sed -i "s/PKG_RELEASE:=.*/PKG_RELEASE:=1/" "sdk/package/${PKG_NAME}/Makefile" sed -i "s/PKG_RELEASE:=.*/PKG_RELEASE:=1/" "sdk/package/${PACKAGE_NAME}/Makefile"
else
echo "❌ Package $PACKAGE_NAME not found or missing Makefile"
exit 1
fi fi
done else
echo "📦 Copying all packages (version: $VERSION)..."
for pkg in luci-app-*/; do
if [[ -d "$pkg" && -f "${pkg}Makefile" ]]; then
PKG_NAME=$(basename "$pkg")
echo " 📁 $PKG_NAME"
cp -r "$pkg" sdk/package/
# Update version
sed -i "s/PKG_VERSION:=.*/PKG_VERSION:=$VERSION/" "sdk/package/${PKG_NAME}/Makefile"
sed -i "s/PKG_RELEASE:=.*/PKG_RELEASE:=1/" "sdk/package/${PKG_NAME}/Makefile"
fi
done
fi
echo "" echo ""
echo "📋 Packages in SDK:" echo "📋 Packages in SDK:"
ls -d sdk/package/luci-app-*/ 2>/dev/null || echo "None" ls -d sdk/package/luci-app-*/ 2>/dev/null || echo "None"
@ -464,38 +508,46 @@ jobs:
- name: Create combined archives - name: Create combined archives
run: | run: |
VERSION="${{ needs.setup.outputs.version }}" VERSION="${{ needs.setup.outputs.version }}"
PACKAGE_NAME="${{ github.event.inputs.package_name }}"
mkdir -p release mkdir -p release
echo "📁 Creating combined archives..." # Determine prefix for archives
if [[ -n "$PACKAGE_NAME" ]]; then
PREFIX="${PACKAGE_NAME}"
echo "📁 Creating archives for single package: $PACKAGE_NAME..."
else
PREFIX="secubox"
echo "📁 Creating combined archives..."
fi
# Per-architecture 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"
# Copy .ipk files to release # Copy .ipk files to release
mkdir -p "release/${ARCH}" mkdir -p "release/${ARCH}"
cp "$dir"/*.ipk "release/${ARCH}/" 2>/dev/null || true cp "$dir"/*.ipk "release/${ARCH}/" 2>/dev/null || true
# Create archive # Create archive
if ls "release/${ARCH}"/*.ipk >/dev/null 2>&1; then if ls "release/${ARCH}"/*.ipk >/dev/null 2>&1; then
tar -czf "release/secubox-${VERSION}-${ARCH}.tar.gz" -C "release/${ARCH}" . tar -czf "release/${PREFIX}-${VERSION}-${ARCH}.tar.gz" -C "release/${ARCH}" .
fi fi
done done
# Create all-in-one archive # Create all-in-one archive
tar -czf "release/secubox-${VERSION}-all-architectures.tar.gz" -C packages . tar -czf "release/${PREFIX}-${VERSION}-all-architectures.tar.gz" -C packages .
# Checksums # Checksums
cd release cd release
sha256sum *.tar.gz > SHA256SUMS 2>/dev/null || true sha256sum *.tar.gz > SHA256SUMS 2>/dev/null || true
echo "" echo ""
echo "📋 Release contents:" echo "📋 Release contents:"
ls -la ls -la
echo "" echo ""
echo "📊 Package count per architecture:" echo "📊 Package count per architecture:"
for dir in */; do for dir in */; do
@ -558,15 +610,17 @@ jobs:
- 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: ${{ github.event.inputs.package_name && format('{0} {1}', github.event.inputs.package_name, needs.setup.outputs.version) || format('SecuBox {0}', needs.setup.outputs.version) }}
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('v{0}', 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 }} ## 📦 ${{ github.event.inputs.package_name && format('{0} Package', github.event.inputs.package_name) || 'SecuBox Packages' }} v${{ needs.setup.outputs.version }}
Pre-built LuCI packages for OpenWrt ${{ env.OPENWRT_VERSION }}. Pre-built LuCI package${{ github.event.inputs.package_name && '' || 's' }} for OpenWrt ${{ env.OPENWRT_VERSION }}.
${{ github.event.inputs.package_name && format('🎯 **Single package build**: {0}', github.event.inputs.package_name) || '' }}
### ✅ Built Packages ### ✅ Built Packages
${{ steps.list-packages.outputs.packages }} ${{ steps.list-packages.outputs.packages }}
### 📥 Installation ### 📥 Installation
@ -622,6 +676,8 @@ jobs:
- name: Generate summary - name: Generate summary
run: | run: |
PACKAGE_NAME="${{ github.event.inputs.package_name }}"
echo "# 📊 SecuBox Build Summary" >> $GITHUB_STEP_SUMMARY echo "# 📊 SecuBox Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
@ -629,6 +685,13 @@ jobs:
echo "| Version | ${{ needs.setup.outputs.version }} |" >> $GITHUB_STEP_SUMMARY echo "| Version | ${{ needs.setup.outputs.version }} |" >> $GITHUB_STEP_SUMMARY
echo "| OpenWrt | ${{ env.OPENWRT_VERSION }} |" >> $GITHUB_STEP_SUMMARY echo "| OpenWrt | ${{ env.OPENWRT_VERSION }} |" >> $GITHUB_STEP_SUMMARY
echo "| Triggered by | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY echo "| Triggered by | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
if [[ -n "$PACKAGE_NAME" ]]; then
echo "| Package | 🎯 $PACKAGE_NAME (single package build) |" >> $GITHUB_STEP_SUMMARY
else
echo "| Package | 📦 All packages |" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY
echo "## Build Results" >> $GITHUB_STEP_SUMMARY echo "## Build Results" >> $GITHUB_STEP_SUMMARY

View File

@ -413,18 +413,43 @@ Packages are compiled automatically when:
1. Go to **Actions** → **Build OpenWrt Packages** 1. Go to **Actions** → **Build OpenWrt Packages**
2. Click **Run workflow** 2. Click **Run workflow**
3. Select: 3. Select build options:
- **OpenWrt version**: 23.05.5, 22.03.7, or SNAPSHOT - **Package name**: Choose a specific package or leave empty for all packages
- **OpenWrt version**: 23.05.5, 24.10.0, or SNAPSHOT
- **Architectures**: `all` or comma-separated list - **Architectures**: `all` or comma-separated list
#### Build All Packages
Leave "Package name" empty and select architectures:
```bash ```bash
# Examples # Architecture examples
all # All architectures all # All supported architectures
x86-64 # x86_64 only x86-64 # x86_64 only
aarch64-cortex-a53,aarch64-cortex-a72 # GlobalScale devices aarch64-cortex-a53,aarch64-cortex-a72 # ARM64 devices
mips-24kc,mipsel-24kc # MIPS routers mips-24kc,mipsel-24kc # MIPS routers
``` ```
#### Build Single Package
Select a specific package from the dropdown to build only that module:
- `luci-app-secubox` - Central Hub
- `luci-app-system-hub` - System Control Center
- `luci-app-crowdsec-dashboard` - CrowdSec Security
- `luci-app-netdata-dashboard` - System Monitoring
- `luci-app-netifyd-dashboard` - DPI & Traffic Analysis
- `luci-app-wireguard-dashboard` - WireGuard VPN
- `luci-app-network-modes` - Network Configuration
- `luci-app-client-guardian` - NAC & Captive Portal
- `luci-app-auth-guardian` - Authentication System
- `luci-app-bandwidth-manager` - QoS & Quotas
- `luci-app-media-flow` - Media Detection
- `luci-app-cdn-cache` - CDN Proxy Cache
- `luci-app-vhost-manager` - Virtual Hosts
**Use case**: Quickly test a single module after making changes, without waiting for all packages to build.
### Download Artifacts ### Download Artifacts
1. Go to **Actions** → Select workflow run 1. Go to **Actions** → Select workflow run