name: build-gl-inet-23.05.4 ImmortalWrt on: workflow_dispatch: inputs: profile: type: choice description: "请选择路由器型号" required: true options: - glinet_gl-mt3000 - glinet_gl-mt2500 - glinet_gl-mt6000 - glinet_gl-b2200 default: glinet_gl-mt3000 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: Download Clash Meta, GeoIP, and GeoSite run: | PLATFORM="arm64" mkdir -p files/etc/openclash/core # Download clash_meta META_URL="https://raw.githubusercontent.com/vernesong/OpenClash/core/master/meta/clash-linux-${PLATFORM}.tar.gz" wget -qO- $META_URL | tar xOvz > files/etc/openclash/core/clash_meta chmod +x files/etc/openclash/core/clash_meta # Download GeoIP and GeoSite wget -q https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -O files/etc/openclash/GeoIP.dat wget -q https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -O files/etc/openclash/GeoSite.dat - name: Build Gl-iNet ImmortalWrt 23.05.4 run: | profiles="${{ github.event.inputs.profile }}" include_docker="${{ github.event.inputs.include_docker }}" if [ "$profiles" = "glinet_gl-b2200" ]; then tag=ipq40xx-generic-openwrt-23.05.4 echo "platform=ipq40xx/generic" >> $GITHUB_ENV else tag=mediatek-filogic-openwrt-23.05.4 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 }}/mediatek-filogic/build.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: Generate Firmware SHA-256 run: | cp ${{ github.workspace }}/bin/targets/${{ env.platform }}/*.bin ${{ github.workspace }} for file in *.bin; do sha256sum "$file" > "$file.sha256" sha256sum -c "$file.sha256" 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: Autobuild-GL-iNet name: ImmortalWrt-GL-iNet body_path: ${{ github.workspace }}/mediatek-filogic/info.md files: | ${{ github.workspace }}/*.bin ${{ github.workspace }}/*.sha256 token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}