name: Build boxs by ophub on: workflow_dispatch: inputs: luci_version: description: "选择luci版本" required: false default: "24.10.3" type: choice options: - 24.10.0 - 24.10.1 - 24.10.2 - 24.10.3 openwrt_kernel: description: "选择构建的内核 当高版本内核没有时 系统会自动挑选匹配的内核。比如radxa e52c 即便你选择了6.1.y 可能最终构建还是5.10.160" required: false default: "6.1.y" type: choice options: - 5.4.y - 5.10.y - 5.15.y - 6.1.y - 6.6.y - 6.12.y openwrt_board: description: "选择型号" required: false default: "a311d-oes" type: choice options: - a311d - a311d-oes - s922x-oes-plus - wxy-oect - wxy-oect-replaced - panther-x2 - jp-tvbox - s905x3-hk1 - tanix-tx6 - s905l-b860av21u - s905l2-e900v21e - s905l - s905l-aurora-1s - s905l-mg101 - s905l2 - s905l2-wojia - s905l3 - s905l3-cm211 - s905l3-unt400g1 - s905l3-unt402a - s905l3a - s905l3a-cm311 - s905l3a-m401a - s905l3b - s905l3b-e900v21d - s905l3b-e900v22d - s905l3b-e900v22e - s905l3b-ip103h - s905l3b-rg020et-ca - s905l3b-unt403a - s905lb-ipbs9505 - s905lb-q96-mini - s905lb-r3300l - r66s - r68s - nanopc-t6 - nanopi-r5c - nanopi-r5s - orangepi-5-plus - orangepi-5b - alark35-3500 - anas3035 - beikeyun - chainedbox - crrc - dc-a588 - dg3399 - dg-tn3568 - dlfr100 - e20c - e25 - eaidk-610 - emb3531 - fine3399 - firefly-rk3399 - fmx1-pro - h28k - h66k - h68k - h69k - h88k - h88k-v3 - h96-max-m2 - hs530r - hugsun-x99 - ipc-r - king3399 - kylin3399 - lckfb-tspi - leez - lx-r3s - mrkaio-m68s - renegade-rk3328 - rk3318-box - rock5b - rock5c - ruisen-box - s905 - s905-beelink-mini - s905-mxqpro-plus - s905d-ki-pro - s905d-sml5442tw - s905mb - s905w - s905w-w95 - s905w-x96-mini - s905w-x96w - s905x - s905x-b860h - s905x-nexbox-a95x - s905x-t95 - s905x-tbee - s905x-tx9 - s905x2 - s905x2-km3 - s905x2-x96max-2g - s905x3 - s905x3-2101 - s905x3-a100 - s905x3-a95xf3 - s905x3-a95xf3-gb - s905x3-b - s905x3-h96max - s905x3-ip1001m - s905x3-q1 - s905x3-q2 - s905x3-tx3 - s905x3-tx3-bz - s905x3-ugoosx3 - s905x3-whale - s905x3-x88-pro-x3 - s905x3-x96air - s905x3-x96air-gb - s905x3-x96max - s905x2-hg680fj - s912 - s912-h96pro-plus - s912-m8s-pro - s912-nexbox-a1 - s912-nexbox-a2 - s912-onecloudpro - s912-phicomm-t1 - s912-t95z-plus - s912-tx8-max - s912-tx9-pro-2g - s912-tx9-pro-3g - s912-x92 - s912-zyxq-fake - s922x - s922x-ct2000 - s922x-gtking - s922x-gtkingpro-h - s922x-odroid-n2 - s922x-reva - s922x-ugoos-am6 - seewo-sv21 - smart-am40 - smart-am60 - station-m1 - station-m2 - sv-33a6x - swan1-w28 - sw799 - tb-ls3399 - tn3399 - tpm312 - tqc-a01 - tvi3315a - vplus - xiaobao - yskj - zcube1-max - zk-r39a - zysj include_docker: description: | 是否编译 Docker 插件 required: true default: 'no' type: choice options: - 'yes' - 'no' enable_store: description: "集成 store 商店" required: false type: boolean default: true skip_imagebuilder: description: "直接使用底包快速构建固件, 忽略自定义插件 ----(跳过 ImageBuilder)" required: false default: false type: boolean replace_banner: description: '替换为ImmortalWrt的banner信息' required: false default: false type: boolean rootfs_partsize: description: '软件包大小1G固定' required: true default: "1024" type: choice options: - '1024' builder_name: description: "设置打包作者的名称" required: true default: 'wukongdaily' jobs: build: runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 - name: Set executable permissions run: chmod +x ${{ github.workspace }}/n1/build.sh - name: Debug workspace contents run: ls -R - name: Enable Store integration run: | if [ "${{ github.event.inputs.enable_store }}" == "true" ]; then echo 'CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-store"' >> shell/custom-packages.sh echo "✅ 已追加 luci-app-store" else echo "❎ 未启用 luci-app-store" fi - name: 处理是否替换 banner 信息 if: ${{ github.event.inputs.skip_imagebuilder == 'false' && github.event.inputs.replace_banner == 'true' }} run: | # 使用ImageBuilder构建 且用户勾选了替换banner时 cp n1/99-banner.sh files/etc/uci-defaults/ - name: Build Rootfs for Radxa and Other Boards (ImmortalWrt) if: ${{ github.event.inputs.skip_imagebuilder != 'true' }} run: | echo "✅ 使用 ImageBuilder 构建 rootfs" profiles="generic" include_docker="${{ github.event.inputs.include_docker }}" rootfs_partsize="${{ github.event.inputs.rootfs_partsize }}" luci_version="${{ github.event.inputs.luci_version }}" IFS=',' read -r -a profile_array <<< "$profiles" for profile in "${profile_array[@]}"; do echo "Building for profile: $profile" docker run --rm -i \ --user root \ -v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \ -v "${{ github.workspace }}/files/etc/uci-defaults:/home/build/immortalwrt/files/etc/uci-defaults" \ -v "${{ github.workspace }}/arch/arch.conf:/home/build/immortalwrt/files/etc/opkg/arch.conf" \ -v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \ -v "${{ github.workspace }}/n1/banner:/home/build/immortalwrt/files/mnt/banner" \ -v "${{ github.workspace }}/n1/imm.config:/home/build/immortalwrt/.config" \ -v "${{ github.workspace }}/n1/build.sh:/home/build/immortalwrt/build.sh" \ -e PROFILE=$profile \ -e INCLUDE_DOCKER=$include_docker \ -e ROOTFS_PARTSIZE=$rootfs_partsize \ immortalwrt/imagebuilder:armsr-armv8-openwrt-${luci_version} /bin/bash /home/build/immortalwrt/build.sh done - name: Download prebuilt rootfs.tar.gz if: ${{ github.event.inputs.skip_imagebuilder == 'true' }} run: | echo "📦 正在下载预构建 rootfs" echo "PREBUILT_LUCI_VERSION=24.10.2" >> $GITHUB_ENV mkdir -p bin/targets/armsr/armv8 curl -L -o bin/targets/armsr/armv8/openwrt-armvirt-64-default-rootfs.tar.gz \ https://github.com/wukongdaily/AutoBuildImmortalWrt/releases/download/rootfs/immortalwrt-24.10.2-armsr-armv8-generic-rootfs.tar.gz - name: 查找rootfs.tar.gz所在路径 id: find_rootfs run: | ROOTFS_FILE=$(find bin/targets/armsr/armv8/ -type f -name "*rootfs.tar.gz" | head -n1) echo "✅ Found: $ROOTFS_FILE" if [ ! -f "$ROOTFS_FILE" ]; then echo "❌ 找不到 rootfs.tar.gz 文件" exit 1 fi echo "file=$ROOTFS_FILE" >> $GITHUB_OUTPUT - name: Package armsr-armv8 as ImmortalWrt by ophub uses: ophub/amlogic-s9xxx-openwrt@main with: openwrt_path: ${{ steps.find_rootfs.outputs.file }} openwrt_board: ${{ inputs.openwrt_board }} openwrt_kernel: ${{ inputs.openwrt_kernel }} auto_kernel: true kernel_repo: "ophub/kernel" kernel_usage: flippy builder_name: ${{ inputs.builder_name }} - name: Rename .img.gz files id: rename run: | MODEL=${{ inputs.openwrt_board }} LUCI_VERSION="${{ github.event.inputs.luci_version }}" for FILE in ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz; do echo "Processing file: $FILE" FILENAME=$(basename "$FILE") KERNEL_VERSION=$(echo "$FILENAME" | grep -oP 'k\d+\.\d+\.\d+') if [[ -z "$KERNEL_VERSION" ]]; then echo "Skipped: Could not extract kernel version from $FILENAME" continue fi if [ -n "$PREBUILT_LUCI_VERSION" ]; then echo "PREBUILT_LUCI_VERSION is not empty: $PREBUILT_LUCI_VERSION" NEW_NAME="immortalwrt-${PREBUILT_LUCI_VERSION}-${MODEL}-btrfs-${KERNEL_VERSION}.img.gz" else NEW_NAME="immortalwrt-${LUCI_VERSION}-${MODEL}-btrfs-${KERNEL_VERSION}.img.gz" fi mv "$FILE" "${{ env.PACKAGED_OUTPUTPATH }}/$NEW_NAME" echo "Renamed to: $NEW_NAME" done - name: Upload firmware to GitHub Releases uses: softprops/action-gh-release@v2.2.1 with: tag_name: ophub name: ImmortalWrt for boxs body_path: ${{ github.workspace }}/n1/box.md files: | ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}