|
| 1 | +name: BuildImage-all |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + schedule: |
| 6 | + - cron: "0 21 * * *" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build_openclash: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + version: [master, 23.05.3] |
| 14 | + arch: [mediatek-filogic] |
| 15 | + name: Build OpenClash for OpenWRT-${{ matrix.arch }}-${{ matrix.version }} |
| 16 | + runs-on: ubuntu-latest |
| 17 | + defaults: |
| 18 | + run: |
| 19 | + shell: bash |
| 20 | + steps: |
| 21 | + - name: Maximize build space |
| 22 | + uses: easimon/maximize-build-space@v8 |
| 23 | + with: |
| 24 | + root-reserve-mb: 1024 |
| 25 | + swap-size-mb: 1024 |
| 26 | + remove-dotnet: 'true' |
| 27 | + remove-android: 'true' |
| 28 | + remove-haskell: 'true' |
| 29 | + remove-codeql: 'true' |
| 30 | + remove-docker-images: 'true' |
| 31 | + |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + with: |
| 35 | + fetch-depth: 0 |
| 36 | + |
| 37 | + - name: modify docker path |
| 38 | + run: | |
| 39 | + sudo systemctl stop docker.socket |
| 40 | + sudo systemctl stop docker |
| 41 | + sudo mkdir -p ${{ github.workspace }}/docker |
| 42 | + sudo mv /var/lib/docker ${{ github.workspace }}/docker |
| 43 | + sudo ln -sf ${{ github.workspace }}/docker /var/lib/docker |
| 44 | + sudo systemctl start docker |
| 45 | +
|
| 46 | + - name: Run Make |
| 47 | + run: | |
| 48 | + chmod +x ${{ github.workspace }}/build_clash.sh |
| 49 | + mkdir -p ${{ github.workspace }}/openclash |
| 50 | + docker run -i --name openwrt-sdk-${{ matrix.arch }}-${{ matrix.version }} --user root -v ${{ github.workspace }}/build_clash.sh:/build_clash.sh -v ${{ github.workspace }}/openclash/:/openclash/ openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} /build_clash.sh |
| 51 | +
|
| 52 | + - uses: actions/upload-artifact@v3 |
| 53 | + with: |
| 54 | + name: openclash-${{ matrix.arch }}-${{ matrix.version }} |
| 55 | + path: openclash |
| 56 | + |
| 57 | + build_passwall: |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + version: [master, 23.05.3] |
| 62 | + arch: [mediatek-filogic] |
| 63 | + name: Build Passwall for OpenWRT-${{ matrix.arch }}-${{ matrix.version }} |
| 64 | + runs-on: ubuntu-latest |
| 65 | + container: |
| 66 | + image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} |
| 67 | + options: --user root |
| 68 | + defaults: |
| 69 | + run: |
| 70 | + shell: bash |
| 71 | + steps: |
| 72 | + |
| 73 | + - name: Install golang |
| 74 | + run: | |
| 75 | + # VERSION=`curl -L https://golang.org/VERSION?m=text|awk 'NR==1{print $0}'` |
| 76 | + VERSION="go1.20.3" |
| 77 | + wget https://go.dev/dl/$VERSION.linux-amd64.tar.gz |
| 78 | + rm -rf /usr/local/go |
| 79 | + tar -C /usr/local -xzf $VERSION.linux-amd64.tar.gz |
| 80 | + rm -rf $VERSION.linux-amd64.tar.gz |
| 81 | + export GOROOT=/usr/local/go |
| 82 | + export PATH=$PATH:/usr/local/go/bin |
| 83 | + go version |
| 84 | +
|
| 85 | + - name: Run Make |
| 86 | + run: | |
| 87 | + export VOLUME_HOME=$(pwd) |
| 88 | + export BUILD_DIR="/builder" |
| 89 | + export BUILDER="buildbot" |
| 90 | + export GOROOT=/usr/local/go |
| 91 | + export PATH=$PATH:/usr/local/go/bin |
| 92 | + cd $BUILD_DIR |
| 93 | + apt-get update |
| 94 | + apt install sudo -y |
| 95 | + sudo -u $BUILDER echo "src-git passwall https://github.com/xiaorouji/openwrt-passwall.git;main" >> "feeds.conf.default" |
| 96 | + sudo -u $BUILDER echo "src-git passwall_packages https://github.com/xiaorouji/openwrt-passwall-packages.git;main" >> "feeds.conf.default" |
| 97 | + chown -R $BUILDER:$BUILDER $BUILD_DIR |
| 98 | + while ! sudo -u $BUILDER ./scripts/feeds update -a; do echo "Try again"; done |
| 99 | + sudo -u $BUILDER ./scripts/feeds install luci-app-passwall |
| 100 | + sudo -u $BUILDER make defconfig |
| 101 | + ### enable all passwall packages |
| 102 | + # sudo -u $BUILDER sed -i "s/# \(CONFIG_PACKAGE_luci-app-passwall_.*\) is not set/\1=y/g" .config |
| 103 | + ### disable singbox |
| 104 | + # sudo -u $BUILDER sed -i '/CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y/ s/=y/=n/' .config |
| 105 | + ### disable v2ray-plugin |
| 106 | + # sudo -u $BUILDER sed -i '/CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin=y/ s/=y/=n/' .config |
| 107 | + ### set golang external bootstrap root |
| 108 | + # sed -i 's|CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT=""|CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/local/go"|' .config |
| 109 | + sudo -u $BUILDER make package/luci-app-passwall/compile V=99 -j1 || cat logs/feeds/passwall/luci-app-passwall/dump.txt |
| 110 | + mkdir -p $VOLUME_HOME/passwall |
| 111 | + cp -r bin/packages/*/passwall/* $VOLUME_HOME/passwall |
| 112 | + cp -r bin/packages/*/passwall_packages/* $VOLUME_HOME/passwall |
| 113 | + ### do not copy all packages, just copy passwall and passwall_packages |
| 114 | + # cp -r bin/packages/*/packages/* $VOLUME_HOME/passwall |
| 115 | + # cp -r bin/packages $VOLUME_HOME/passwall |
| 116 | +
|
| 117 | + - name: Debug Print |
| 118 | + run: | |
| 119 | + export VOLUME_HOME=$(pwd) |
| 120 | + export BUILD_DIR="/builder" |
| 121 | + export BUILDER="buildbot" |
| 122 | + export PATH=$PATH:/usr/local/go/bin |
| 123 | + cd $BUILD_DIR |
| 124 | + apt-get update |
| 125 | + apt install tree -y |
| 126 | + tree bin/packages |
| 127 | + - uses: actions/upload-artifact@v3 |
| 128 | + with: |
| 129 | + name: passwall-${{ matrix.arch }}-${{ matrix.version }} |
| 130 | + path: passwall |
| 131 | + |
| 132 | + build_theme_argon: |
| 133 | + strategy: |
| 134 | + fail-fast: false |
| 135 | + matrix: |
| 136 | + version: [master, 23.05.3] |
| 137 | + arch: [mediatek-filogic] |
| 138 | + name: Build Argon for OpenWRT-${{ matrix.arch }}-${{ matrix.version }} |
| 139 | + runs-on: ubuntu-latest |
| 140 | + container: |
| 141 | + image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} |
| 142 | + options: --user root |
| 143 | + defaults: |
| 144 | + run: |
| 145 | + shell: bash |
| 146 | + steps: |
| 147 | + - uses: actions/checkout@v4 |
| 148 | + - name: Run Make |
| 149 | + run: | |
| 150 | + export VOLUME_HOME=$(pwd) |
| 151 | + export BUILD_DIR="/builder" |
| 152 | + export BUILDER="buildbot" |
| 153 | + cd $BUILD_DIR |
| 154 | + apt-get update |
| 155 | + apt install sudo -y |
| 156 | + sudo -u $BUILDER git clone https://github.com/jerrykuku/luci-theme-argon.git package/luci-theme-argon |
| 157 | + while ! sudo -u $BUILDER ./scripts/feeds update -a; do echo "Try again"; done |
| 158 | + sudo -u $BUILDER make defconfig |
| 159 | + sudo -u $BUILDER make package/luci-theme-argon/compile V=s -j1 |
| 160 | + mkdir -p $VOLUME_HOME/luci-theme-argon |
| 161 | + cp bin/packages/*/base/luci-theme-argon*.ipk $VOLUME_HOME/luci-theme-argon/ |
| 162 | + - uses: actions/upload-artifact@v3 |
| 163 | + with: |
| 164 | + name: luci-theme-argon-${{ matrix.arch }}-${{ matrix.version }} |
| 165 | + path: luci-theme-argon |
| 166 | + |
| 167 | + # luci app netdata has some bugs, so just not use it for now! |
| 168 | + build_luci_app_netdata: |
| 169 | + strategy: |
| 170 | + fail-fast: false |
| 171 | + matrix: |
| 172 | + version: [master, 23.05.3] |
| 173 | + arch: [mediatek-filogic] |
| 174 | + name: Build Luci App Netdata for OpenWRT-${{ matrix.arch }}-${{ matrix.version }} |
| 175 | + runs-on: ubuntu-latest |
| 176 | + container: |
| 177 | + image: openwrt/sdk:${{ matrix.arch }}-${{ matrix.version }} |
| 178 | + options: --user root |
| 179 | + defaults: |
| 180 | + run: |
| 181 | + shell: bash |
| 182 | + steps: |
| 183 | + - uses: actions/checkout@v4 |
| 184 | + - name: Run Make |
| 185 | + run: | |
| 186 | + export VOLUME_HOME=$(pwd) |
| 187 | + export BUILD_DIR="/builder" |
| 188 | + export BUILDER="buildbot" |
| 189 | + cd $BUILD_DIR |
| 190 | + apt-get update |
| 191 | + apt install sudo -y |
| 192 | + sudo -u $BUILDER git clone https://github.com/sirpdboy/luci-app-netdata package/luci-app-netdata |
| 193 | + while ! sudo -u $BUILDER ./scripts/feeds update -a; do echo "Try again"; done |
| 194 | + sudo -u $BUILDER ./scripts/feeds install -a |
| 195 | + sudo -u $BUILDER make defconfig |
| 196 | + sudo -u $BUILDER make package/luci-app-netdata/compile V=s -j1 |
| 197 | + mkdir -p $VOLUME_HOME/luci-app-netdata |
| 198 | + cp bin/packages/*/base/luci-app-netdata*.ipk $VOLUME_HOME/luci-app-netdata/ |
| 199 | + - uses: actions/upload-artifact@v3 |
| 200 | + with: |
| 201 | + name: luci-app-netdata-${{ matrix.arch }}-${{ matrix.version }} |
| 202 | + path: luci-app-netdata |
| 203 | + |
| 204 | + build_image: |
| 205 | + strategy: |
| 206 | + fail-fast: false |
| 207 | + matrix: |
| 208 | + version: [master, 22.03.6, 23.05.3] |
| 209 | + arch: [mediatek-filogic] |
| 210 | + if: ${{ always() }} |
| 211 | + needs: [build_passwall, build_theme_argon, build_luci_app_netdata, build_openclash] |
| 212 | + name: Build Image for OpenWRT-${{ matrix.arch }}-${{ matrix.version }} |
| 213 | + runs-on: ubuntu-latest |
| 214 | + # container: |
| 215 | + # image: openwrt/imagebuilder:${{ matrix.arch }}-${{ matrix.version }} |
| 216 | + # options: --user root |
| 217 | + defaults: |
| 218 | + run: |
| 219 | + shell: bash |
| 220 | + steps: |
| 221 | + - name: Maximize build space |
| 222 | + uses: easimon/maximize-build-space@v8 |
| 223 | + with: |
| 224 | + root-reserve-mb: 1024 |
| 225 | + swap-size-mb: 1024 |
| 226 | + remove-dotnet: 'true' |
| 227 | + remove-android: 'true' |
| 228 | + remove-haskell: 'true' |
| 229 | + remove-codeql: 'true' |
| 230 | + remove-docker-images: 'true' |
| 231 | + |
| 232 | + - name: Checkout |
| 233 | + uses: actions/checkout@v4 |
| 234 | + with: |
| 235 | + fetch-depth: 0 |
| 236 | + |
| 237 | + - uses: actions/download-artifact@v3 |
| 238 | + with: |
| 239 | + name: passwall-${{ matrix.arch }}-${{ matrix.version }} |
| 240 | + - uses: actions/download-artifact@v3 |
| 241 | + with: |
| 242 | + name: luci-theme-argon-${{ matrix.arch }}-${{ matrix.version }} |
| 243 | + - uses: actions/download-artifact@v3 |
| 244 | + with: |
| 245 | + name: openclash-${{ matrix.arch }}-${{ matrix.version }} |
| 246 | + # - uses: actions/download-artifact@v3 |
| 247 | + # with: |
| 248 | + # name: luci-app-netdata |
| 249 | + |
| 250 | + - name: modify docker path |
| 251 | + run: | |
| 252 | + sudo systemctl stop docker.socket |
| 253 | + sudo systemctl stop docker |
| 254 | + sudo mkdir -p ${{ github.workspace }}/docker |
| 255 | + sudo mv /var/lib/docker ${{ github.workspace }}/docker |
| 256 | + sudo ln -sf ${{ github.workspace }}/docker /var/lib/docker |
| 257 | + sudo systemctl start docker |
| 258 | +
|
| 259 | +
|
| 260 | + - name: Prepare Packages |
| 261 | + run: | |
| 262 | + export VOLUME_HOME=${{ github.workspace }} |
| 263 | + export BUILD_DIR="/builder" |
| 264 | + export BUILDER="buildbot" |
| 265 | + mkdir -p $VOLUME_HOME/mypackages |
| 266 | + mv $VOLUME_HOME/*.ipk $VOLUME_HOME/mypackages/ |
| 267 | +
|
| 268 | + - name: Set profile |
| 269 | + run: | |
| 270 | + echo "profile=mediatek-filogic-nradio-c8-668" >> $GITHUB_ENV |
| 271 | + - name: Make Image |
| 272 | + run: | |
| 273 | + export VOLUME_HOME=${{ github.workspace }} |
| 274 | + export BUILD_DIR="/builder" |
| 275 | + export BUILDER="buildbot" |
| 276 | + chmod +x $VOLUME_HOME/build_image.sh |
| 277 | + docker run -i --name openwrt-imagebuilder-${{ matrix.arch }}-${{ matrix.version }} \ |
| 278 | + --user root \ |
| 279 | + -v $VOLUME_HOME/mypackages/:$BUILD_DIR/packages/mypackages/ \ |
| 280 | + -v $VOLUME_HOME/openwrt_output/:/openwrt_output/ \ |
| 281 | + -v $VOLUME_HOME/build_image.sh:/build_image.sh \ |
| 282 | + -e PROFILE=${{ env.profile }} \ |
| 283 | + -e PACKAGES="${{ env.packages }}" \ |
| 284 | + -e ROOTFS_SIZE=${{ env.rootfs_size }} \ |
| 285 | + -e KERNEL_SIZE=${{ env.kernel_size }} \ |
| 286 | + -e ARCH=${{ matrix.arch }} \ |
| 287 | + -e VERSION=${{ matrix.version }} \ |
| 288 | + openwrt/imagebuilder:${{ matrix.arch }}-${{ matrix.version }} /build_image.sh |
| 289 | +
|
| 290 | + env: |
| 291 | + rootfs_size: 4096 |
| 292 | + kernel_size: 256 |
| 293 | + packages: luci luci-app-qos luci-app-upnp luci-proto-ipv6 kmod-igc kmod-mt7921e |
| 294 | + luci-i18n-base-zh-cn netdata luci-app-ttyd pciutils |
| 295 | + coreutils-timeout lm-sensors lm-sensors-detect fdisk shadow-useradd -dnsmasq |
| 296 | + vim python3 python3-yaml sudo docker dockerd docker-compose ipset samba4-server |
| 297 | + openvpn-openssl luci-app-openvpn lsof kmod-usb-storage block-mount lsblk luci-app-samba4 |
| 298 | + tcpdump zstd tmux bash netcat ip6tables-mod-nat iptables-mod-tproxy dnsmasq-full hostapd |
| 299 | + wpa-supplicant xl2tpd tailscale kmod-loop nfs-kernel-server iptables-mod-socket |
| 300 | + iptables-mod-iprange mwan3 luci-app-mwan3 kmod-nft-socket kmod-nft-tproxy kmod-nft-nat |
| 301 | + wireguard-tools kmod-wireguard luci-app-wireguard luci-proto-wireguard |
| 302 | + base-files busybox ca-bundle dropbear e2fsprogs f2fsck firewall4 fstools kmod-crypto-hw-safexcel kmod-gpio-button-hotplug kmod-leds-gpio kmod-mt7915e kmod-mt7981-firmware kmod-nft-offload kmod-phy-aquantia kmod-usb3 libc libgcc libustream-mbedtls logd luci mkf2fs mt7981-wo-firmware mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd procd-seccomp procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls |
| 303 | +# luci-theme-argon ntpclient luci-app-ntpc |
| 304 | +# chinadns-ng dns2socks dns2tcp luci-app-passwall luci-i18n-passwall-zh-cn microsocks |
| 305 | +# shadowsocksr-libev-ssr-check shadowsocksr-libev-ssr-local shadowsocksr-libev-ssr-nat |
| 306 | +# shadowsocksr-libev-ssr-redir shadowsocksr-libev-ssr-server simple-obfs-server simple-obfs |
| 307 | +# tcping trojan-plus v2ray-core v2ray-example v2ray-extra v2ray-plugin |
| 308 | +# open-vm-tools |
| 309 | + - uses: actions/upload-artifact@v3 |
| 310 | + with: |
| 311 | + name: openwrt-${{ matrix.arch }}-${{ matrix.version }} |
| 312 | + path: openwrt_output |
0 commit comments