name: build-mediatek-24.10.2 on: workflow_dispatch: inputs: profile: type: choice description: "请选择路由器型号" required: true options: - glinet_gl-mt3000 - glinet_gl-mt2500 - glinet_gl-mt6000 - glinet_gl-b2200 - cudy_tr3000-v1 - cudy_tr3000-v1-ubootmod - cudy_tr3000-256mb-v1 default: cudy_tr3000-256mb-v1 include_docker: description: | 是否编译 Docker 插件 required: true default: 'no' 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 }}/mediatek-filogic/build.sh - 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: Build mediatek ImmortalWrt 24.10.2 run: | profiles="${{ github.event.inputs.profile }}" include_docker="${{ github.event.inputs.include_docker }}" if [ "$profiles" = "glinet_gl-b2200" ]; then tag=ipq40xx-generic-openwrt-24.10.2 echo "platform=ipq40xx/generic" >> $GITHUB_ENV elif [ "$profiles" = "cudy_tr3000-256mb-v1" ]; then tag=mediatek-filogic-24.10-SNAPSHOT echo "platform=mediatek/filogic" >> $GITHUB_ENV else tag=mediatek-filogic-openwrt-24.10.2 echo "platform=mediatek/filogic" >> $GITHUB_ENV fi 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 }}/glinet:/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 }}/mediatek-filogic/build-24.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:$tag /bin/bash /home/build/immortalwrt/build.sh done - name: Create info run: | if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then extra_content="### 默认带docker" echo -e "\n $extra_content" >> ${{ github.workspace }}/mediatek-filogic/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: mediatek-filogic name: mediatek-filogic router body_path: ${{ github.workspace }}/mediatek-filogic/info.md files: | ${{ github.workspace }}/bin/targets/${{ env.platform }}/*.bin ${{ github.workspace }}/bin/targets/${{ env.platform }}/*.itb ${{ github.workspace }}/bin/targets/${{ env.platform }}/*.fip token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}