name: r2s Lean版openwrt minimal on: push: branches: - master paths: - '.github/workflows/r2s_lean_minimal-test.yml' schedule: - cron: '10 08 * * *' jobs: build: runs-on: ubuntu-latest if: github.repository == 'klever1988/nanopi-openwrt' steps: - name: Checkout uses: actions/checkout@master with: ref: master - name: Initialization Environment env: DEBIAN_FRONTEND: noninteractive run: . 1_initialization_environment.sh - name: Clone Source run: . 2_clone_source.sh - name: Patch Kernel run: . patch_kernel_5.4-test.sh - name: Mods run: | cd friendlywrt-rk3328 . ../remove_unused_config.sh cat configs/config_rk3328 | grep "TARGET" >> ../base_rk3328.seed cat ../base_rk3328.seed > configs/config_rk3328 cat minimal_config.seed >> configs/config_rk3328 cd friendlywrt git config --local user.email "action@github.com" && git config --local user.name "GitHub Action" git remote add upstream https://github.com/coolsnowwolf/openwrt && git fetch upstream git checkout upstream/lede-17.01 -b tmp #git checkout 33f7cb735300bd9a099995236ed768c8925fec75 -- target/linux/sunxi/image/ git rm README.md git commit -m 'reset' git checkout origin/master-v19.07.1 git rebase adc1a9a3676b8d7be1b48b5aed185a94d8e42728^ --onto tmp -X theirs curl 'https://git.openwrt.org/?p=openwrt/openwrt.git;a=patch;h=22378beb581b113def1dc392ef75306a2168a163' > ip-full.patch; git apply --reject ip-full.patch || true rm -f target/linux/rockchip-rk3328/patches-4.14/0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch target/linux/generic/hack-4.14/999-net-patch-linux-kernel-to-support-shortcut-fe.patch sed -i '/ipv6/,+3d' package/base-files/files/root/setup.sh git checkout upstream/lede-17.01 -- feeds.conf.default sed -i 's/coolsnowwolf\/packages/klever1988\/packages/' feeds.conf.default sed -i -E 's/#(src-git.+)(helloworld.+)/\1\2/' feeds.conf.default cd package/lean/ git clone https://github.com/NateLol/luci-app-oled #git clone https://github.com/jerrykuku/lua-maxminddb.git #git clone https://github.com/jerrykuku/luci-app-vssr.git #cd luci-app-vssr/root/etc/ #echo 'china_ssr.txt #config/black.list #config/white.list #dnsmasq.oversea/oversea_list.conf #dnsmasq.ssr/ad.conf #dnsmasq.ssr/gfw_base.conf' | xargs rm #cd ../../../ rm -rf luci-theme-argon git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git cd ../../ git apply ../../enable_autocore.diff #git apply ../../fix_cpufreq.diff sed -i 's/@LINUX_5_4//' package/lean/luci-app-flowoffload/Makefile sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/argon"' package/lean/default-settings/files/zzz-default-settings sed -i '/exit/i\chown -R root:root /usr/share/netdata/web' package/lean/default-settings/files/zzz-default-settings sed -i '/exit/i\find /etc/rc.d/ -name *docker* -delete' package/lean/default-settings/files/zzz-default-settings sed -i 's/option fullcone\t1/option fullcone\t0/' package/network/config/firewall/files/firewall.config sed -i '/8.8.8.8/d' package/base-files/files/root/setup.sh mv ../../scripts/check_wan4.sh package/base-files/files/usr/bin && sed -i '/exit/i\/bin/sh /usr/bin/check_wan4.sh &' package/base-files/files/etc/rc.local mv ../../scripts/autoupdate.sh package/base-files/files/root/au.sh && chmod +x package/base-files/files/root/au.sh echo -e '\nDYC Build\n' >> package/base-files/files/etc/banner - name: Add OpenClash run: | git clone -b master https://github.com/vernesong/OpenClash.git mv OpenClash/luci-app-openclash friendlywrt-rk3328/friendlywrt/package cd friendlywrt-rk3328/friendlywrt/package/base-files/files mkdir -p etc/openclash/core && cd etc/openclash/core curl -L https://github.com/vernesong/OpenClash/releases/download/Clash/clash-linux-armv8.tar.gz | tar zxf - chmod +x clash - name: Add Passwall run: | cd friendlywrt-rk3328/friendlywrt echo -e '\nsrc-git lienol https://github.com/Lienol/openwrt-package' >> feeds.conf.default ./scripts/feeds update -a rm -rf feeds/lienol/lienol/ipt2socks rm -rf feeds/lienol/lienol/shadowsocksr-libev rm -rf feeds/lienol/lienol/pdnsd-alt rm -rf feeds/lienol/package/verysync rm -rf feeds/lienol/lienol/luci-app-verysync rm -rf package/lean/luci-app-kodexplorer rm -rf package/lean/luci-app-pppoe-relay rm -rf package/lean/luci-app-pptp-server rm -rf package/lean/luci-app-v2ray-server ./scripts/feeds install -a - name: Build FriendlyWrt run: | cd friendlywrt-rk3328 sed -i 's/set -eu/set -u/' scripts/mk-friendlywrt.sh ./build.sh nanopi_r2s.mk - name: Zip Files run: | gzip friendlywrt-rk3328/out/*.img - name: Assemble Artifact id: assemble_artifact run: | rm -rf ./artifact/ mkdir -p ./artifact/ mv friendlywrt-rk3328/out/*img* ./artifact/ cp friendlywrt-rk3328/friendlywrt/.config ./artifact/ cd ./artifact/ md5sum *img* > md5sum.txt cd .. zip -r artifact.zip ./artifact/ release_tag="R2S-Minimal-$(date +%Y-%m-%d)-test" echo "##[set-output name=release_tag;]$release_tag" - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.sec_token }} with: tag_name: ${{ steps.assemble_artifact.outputs.release_tag }} release_name: 仅测试勿使用 ${{ steps.assemble_artifact.outputs.release_tag }} draft: false prerelease: false - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.sec_token }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./artifact.zip asset_name: ${{ steps.assemble_artifact.outputs.release_tag }}-ROM.zip asset_content_type: application/zip