Files
luci-app-nyn/.github/workflows/build-zzz.yml
dichgrem 3878369ed3 fix:xss&&crontab
update:actions
2026-01-11 13:56:01 +08:00

173 lines
5.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build luci-app-zzz
on:
workflow_dispatch:
inputs:
ramips:
description: 'ramips'
required: false
type: boolean
default: true
filogic:
description: 'filogic'
required: false
type: boolean
default: true
x86_64:
description: 'x86_64'
required: false
type: boolean
default: true
jobs:
matrix-setup:
runs-on: ubuntu-latest
outputs:
architectures: ${{ steps.set-matrix.outputs.architectures }}
steps:
- name: Set matrix
id: set-matrix
run: |
ARCHS='['
if [ "${{ inputs.ramips }}" == "true" ]; then
ARCHS=$ARCHS'"ramips",'
fi
if [ "${{ inputs.filogic }}" == "true" ]; then
ARCHS=$ARCHS'"filogic",'
fi
if [ "${{ inputs.x86_64 }}" == "true" ]; then
ARCHS=$ARCHS'"x86_64",'
fi
ARCHS=${ARCHS%,}
ARCHS=$ARCHS']'
echo "architectures=$ARCHS" >> $GITHUB_OUTPUT
echo "Selected architectures: $ARCHS"
build:
needs: matrix-setup
if: needs.matrix-setup.outputs.architectures != '[]'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: ${{ fromJson(needs.matrix-setup.outputs.architectures) }}
env:
RAMIPS_URL: https://downloads.immortalwrt.org/releases/24.10.3/targets/ramips/mt7621/immortalwrt-sdk-24.10.3-ramips-mt7621_gcc-13.3.0_musl.Linux-x86_64.tar.zst
FILOGIC_URL: https://downloads.immortalwrt.org/releases/24.10.3/targets/mediatek/filogic/immortalwrt-sdk-24.10.3-mediatek-filogic_gcc-13.3.0_musl.Linux-x86_64.tar.zst
X86_URL: https://downloads.immortalwrt.org/releases/24.10.3/targets/x86/64/immortalwrt-sdk-24.10.3-x86-64_gcc-13.3.0_musl.Linux-x86_64.tar.zst
WORK_ROOT: ${{ github.workspace }}/imwrt-sdk
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
echo "👉 正在下载依赖项"
sudo apt-get update
sudo apt-get install -y build-essential git wget python3 rsync zstd g++ make libncurses-dev
echo "✅ 下载完毕"
- name: Set SDK variables
run: |
if [ "${{ matrix.sdk }}" == "ramips" ]; then
echo "SDK_URL=${{ env.RAMIPS_URL }}" >> $GITHUB_ENV
echo "PACKAGE_ARCH=ramips" >> $GITHUB_ENV
elif [ "${{ matrix.sdk }}" == "filogic" ]; then
echo "SDK_URL=${{ env.FILOGIC_URL }}" >> $GITHUB_ENV
echo "PACKAGE_ARCH=aarch64_cortex-a53" >> $GITHUB_ENV
else
echo "SDK_URL=${{ env.X86_URL }}" >> $GITHUB_ENV
echo "PACKAGE_ARCH=x86_64" >> $GITHUB_ENV
fi
- name: Show build target
run: |
echo "👉 正在编译 ${{ matrix.sdk }} 架构 (${{ env.PACKAGE_ARCH }})"
- name: Download & extract SDK
run: |
set -euo pipefail
mkdir -p "$WORK_ROOT"
cd "$WORK_ROOT"
SDK_TAR="$(basename "$SDK_URL")"
echo "👉 正在下载SDK$SDK_TAR"
wget -q "$SDK_URL" -O "$SDK_TAR"
echo "📦 正在解压SDK..."
tar --use-compress-program="zstd -q -d" -xf "$SDK_TAR" >/dev/null 2>&1
echo "✅ SDK解压完成"
SDK_ROOT="$(find . -maxdepth 1 -type d -name 'immortalwrt-sdk*' | head -n 1)"
if [ -z "$SDK_ROOT" ]; then
echo "❌ 未找到SDK目录" >&2
exit 1
fi
SDK_ROOT="$(cd "$SDK_ROOT" && pwd)"
echo "SDK_ROOT=$SDK_ROOT" >> $GITHUB_ENV
echo "📁 SDK路径: $SDK_ROOT"
- name: Setup feeds & clone source
run: |
set -euo pipefail
cd "$SDK_ROOT"
echo "👉 正在设置feeds"
./scripts/feeds update -a
./scripts/feeds update luci || true
./scripts/feeds install -a -p luci || ./scripts/feeds install luci || true
echo "✅ feeds下载完毕"
cd package
git clone https://github.com/Dichgrem/luci-app-nyn.git
cp -r luci-app-nyn/luci-app-zzz . 2>/dev/null || true
cp -r luci-app-nyn/zzz . 2>/dev/null || true
rm -rf luci-app-nyn
- name: Build luci-app-zzz
run: |
set -euo pipefail
cd "$SDK_ROOT"
make defconfig
echo "👉 正在编译中"
make package/luci-app-zzz/compile V=s
echo "✅ 编译完成"
- name: Collect packages
run: |
set -euo pipefail
SDK_ROOT="$SDK_ROOT"
OUT="$GITHUB_WORKSPACE/output"
mkdir -p "$OUT"
echo "🔍 自动检测 SDK 包架构目录..."
BASE_DIR=$(find "$SDK_ROOT/bin/packages" -type d -path "*/base" | head -n1 || true)
if [ -z "$BASE_DIR" ]; then
echo "❌ 未找到 base 目录" >&2
ls -R "$SDK_ROOT/bin/packages" || true
exit 1
fi
echo "📦 从: $BASE_DIR 收集 luci-app-zzz 与 zzz 包..."
ls -lah "$BASE_DIR" || true
cp -v "$BASE_DIR"/*luci-app-zzz*.ipk "$OUT"/ 2>/dev/null || true
cp -v "$BASE_DIR"/*zzz*.ipk "$OUT"/ 2>/dev/null || true
echo "✅ 收集完成,输出目录内容:"
ls -lah "$OUT"
shell: bash
- name: Upload package luci-app-zzz
uses: actions/upload-artifact@v4
with:
name: luci-app-zzz-${{ matrix.sdk }}
path: output/*luci-app-zzz*.ipk
if-no-files-found: error
- name: Upload package zzz
uses: actions/upload-artifact@v4
with:
name: zzz-${{ matrix.sdk }}
path: output/*zzz*.ipk
if-no-files-found: error