name: build-RaspBerryPi-24.10.x on: workflow_dispatch: inputs: profile: type: choice description: "请选择路由器型号" required: true options: - rpi - rpi-2 - rpi-3 - rpi-4 - rpi-5 default: rpi-4 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 enable_store: description: "集成 store 商店" required: false type: boolean default: true include_docker: description: | 是否编译 Docker 插件 required: true default: 'no' type: choice options: - 'yes' - 'no' size: description: '请输入要编译固件大小 单位(MB)' required: true default: '1024' jobs: build: runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v3 - name: Set executable permissions run: | chmod +x ${{ github.workspace }}/raspberrypi/24.10/build.sh - 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 raspberrypi ImmortalWrt 24.10.2 run: | luci_version="${{ github.event.inputs.luci_version }}" profiles="${{ github.event.inputs.profile }}" if [ "$profiles" = "rpi" ]; then tag=bcm27xx-bcm2708-openwrt-${luci_version} echo "cpu=bcm2708" >> $GITHUB_ENV elif [ "$profiles" = "rpi-2" ]; then tag=bcm27xx-bcm2709-openwrt-${luci_version} echo "cpu=bcm2709" >> $GITHUB_ENV elif [ "$profiles" = "rpi-3" ]; then tag=bcm27xx-bcm2710-openwrt-${luci_version} echo "cpu=bcm2710" >> $GITHUB_ENV elif [ "$profiles" = "rpi-4" ]; then tag=bcm27xx-bcm2711-openwrt-${luci_version} echo "cpu=bcm2711" >> $GITHUB_ENV elif [ "$profiles" = "rpi-5" ]; then tag=bcm27xx-bcm2712-openwrt-${luci_version} echo "cpu=bcm2712" >> $GITHUB_ENV fi include_docker="${{ github.event.inputs.include_docker }}" size="${{ github.event.inputs.size }}" 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 }}/raspberrypi/24.10/build.sh:/home/build/openwrt/build.sh" \ -e PROFILE=$profile \ -e INCLUDE_DOCKER=$include_docker \ -e ROOTSIZE=$size \ immortalwrt/imagebuilder:$tag /bin/bash /home/build/openwrt/build.sh done ls ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }} - name: Create info run: | if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then extra_content="### 默认带docker" echo -e "\n $extra_content" >> ${{ github.workspace }}/info.md else echo -e "NO docker" fi - name: Upload ImmortalWrt as release assets uses: softprops/action-gh-release@v2.2.1 with: tag_name: Autobuild-raspberrypi body_path: ${{ github.workspace }}/info.md files: | ${{ github.workspace }}/bin/targets/bcm27xx/${{ env.cpu }}/*squashfs-factory.img.gz token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}