name: Build Dev Board Firmware (Flippy) on: workflow_dispatch: inputs: openwrt_kernel: description: "选择构建的内核 当高版本内核没有时 系统会自动挑选匹配的内核。比如radxa e52c 即便你选择了6.1.y 可能最终构建还是5.10.160" required: false default: "6.6.y" type: choice options: - 5.4.y - 5.10.y - 5.15.y - 6.1.y - 6.6.y - 6.12.y openwrt_soc: description: "选择开发板型号" required: false default: "e25" type: choice options: - e20c - e24c - e25 - e52c - e54c - rock5b - rock5c - r66s - r68s - ht2 - h28k - h66k - h68k - h69k - h69k-max - h88k - h88k-v3 - jp-tvbox - l1pro - s905 - s905x2 - s905x3 - s912 - s922x - s922x-n2 include_docker: description: | 是否编译 Docker 插件 required: true default: 'no' type: choice options: - 'yes' - 'no' 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: 处理是否替换 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 }}" 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-24.10.2 /bin/bash /home/build/immortalwrt/build.sh done - name: Download prebuilt rootfs.tar.gz if: ${{ github.event.inputs.skip_imagebuilder == 'true' }} run: | echo "📦 正在下载预构建 rootfs" 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 for Radxa uses: ophub/flippy-openwrt-actions@main if: ${{ steps.down.outputs.status }} == 'success' && !cancelled() env: OPENWRT_ARMVIRT: ${{ steps.find_rootfs.outputs.file }} PACKAGE_SOC: ${{ inputs.openwrt_soc }} KERNEL_VERSION_NAME: ${{ inputs.openwrt_kernel }} KERNEL_AUTO_LATEST: true WHOAMI: ${{ inputs.builder_name }} - name: Rename .img.gz file id: rename run: | FILE=$(ls ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz | head -n1) echo "Image file is: $FILE" FILENAME=$(basename "$FILE") echo "FILENAME=$FILENAME" >> $GITHUB_ENV KERNEL_VERSION=$(echo "$FILENAME" | grep -oP 'k\d+\.\d+\.\d+') MODEL=${{ inputs.openwrt_soc }} mv "$FILE" "${{ env.PACKAGED_OUTPUTPATH }}/immortalwrt-24.10.2-$MODEL-btrfs-$KERNEL_VERSION.img.gz" - name: Upload firmware to GitHub Releases uses: softprops/action-gh-release@v2.2.1 with: tag_name: flippy name: ImmortalWrt for Radxa Series and Similar Devices body_path: ${{ github.workspace }}/n1/radxa.md files: | ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}