name: build-x86-64-immortalwrt-24.10.x on: workflow_dispatch: inputs: luci_version: description: "选择luci版本" required: false default: "24.10.4" type: choice options: - 24.10.0 - 24.10.1 - 24.10.2 - 24.10.3 - 24.10.4 custom_router_ip: description: "请设置路由器的管理地址(仅对多网口路由器有效) 格式:192.168.x.1 或 10.x.x.1" required: true default: "192.168.100.1" profile: description: '请输入要编译固件大小 单位(MB)' required: true default: '1024' enable_store: description: "集成 store 商店" required: false type: boolean default: true include_docker: description: | 是否编译 Docker 插件 required: true default: 'yes' type: choice options: - 'yes' - 'no' enable_pppoe: description: "是否配置PPPoE拨号信息?" required: true default: 'no' type: choice options: - 'yes' - 'no' pppoe_account: description: "宽带账号 (若启用PPPoE)" required: false pppoe_password: description: "宽带密码 (若启用PPPoE)" required: false jobs: build: runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 - name: Set executable permissions run: chmod +x ${{ github.workspace }}/x86-64/build24.sh - name: Save Custom Router IP into OpenWrt files run: | mkdir -p "${{ github.workspace }}/custom" echo "${{ github.event.inputs.custom_router_ip }}" > "${{ github.workspace }}/custom/custom_router_ip.txt" echo "您设置的路由器管理地址是:${{ github.event.inputs.custom_router_ip }}" # 后续步骤会将该文件映射到路由器/etc/config/custom_router_ip.txt 以便用于开机脚本99-custom.sh读取用户设置的ip - name: Validate PPPoE Inputs run: | if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then echo "Error: PPPoE account and password must be provided when PPPoE is enabled!" exit 1 fi fi - 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: Build ImmortalWrt-x86-64-efi run: | profile="${{ github.event.inputs.profile }}" include_docker="${{ github.event.inputs.include_docker }}" luci_version="${{ github.event.inputs.luci_version }}" echo "Building for profile: $profile" docker run --rm -i \ --user root \ -v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \ -v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \ -v "${{ github.workspace }}/custom:/home/build/immortalwrt/files/etc/config" \ -v "${{ github.workspace }}/x86-64/imm.config:/home/build/immortalwrt/.config" \ -v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \ -v "${{ github.workspace }}/x86-64/build24.sh:/home/build/immortalwrt/build.sh" \ -e PROFILE=$profile \ -e INCLUDE_DOCKER=$include_docker \ -e ENABLE_PPPOE=${{ inputs.enable_pppoe }} \ -e PPPOE_ACCOUNT=${{ inputs.pppoe_account }} \ -e PPPOE_PASSWORD=${{ inputs.pppoe_password }} \ immortalwrt/imagebuilder:x86-64-openwrt-${luci_version} /bin/bash /home/build/immortalwrt/build.sh - name: Create info run: | cat > ${{ github.workspace }}/router-info.md <> ${{ github.workspace }}/router-info.md else echo -e "\n#### 不带docker" >> ${{ github.workspace }}/router-info.md fi - name: Upload ImmortWrt as release assets uses: softprops/action-gh-release@v2.2.1 with: tag_name: Autobuild-x86-64 body_path: ${{ github.workspace }}/router-info.md files: | ${{ github.workspace }}/bin/targets/x86/64/*squashfs-combined-efi.img.gz token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}