name: r2s Lean版openwrt on: push: branches: - master paths: - '.github/workflows/r2s_lean.yml' schedule: - cron: '10 09 * * *' 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: | sudo rm -rf /etc/apt/sources.list.d sudo apt-get update sudo apt-get -y --no-install-recommends install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler curl https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | sed '/#/d' | sed 's/\\//g' | sed 's/exit 0//g' | sed 's/sudo apt -y install//g' | sed 's/sudo apt-get -y install//g' | sed 's/:i386//g' | xargs sudo apt-get -y --no-install-recommends install sudo rm -rf /usr/share/dotnet /usr/local/lib/android/sdk - name: Install Repo run: | git clone https://github.com/friendlyarm/repo sudo cp repo/repo /usr/bin/ - name: Init Source run: | mkdir friendlywrt-rk3328 cd friendlywrt-rk3328 repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v19.07.1 -m rk3328.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle --depth=1 repo sync -c --no-tags --no-clone-bundle -j8 cd friendlywrt/ && git fetch --unshallow - name: Patch Kernel run: | . patch_kernel_5.4.sh - name: Mods run: | cd friendlywrt-rk3328 . ../remove_unused_config.sh cat configs/config_rk3328 | grep "TARGET" >> ../base_rk3328.seed cat ../app_config.seed >> ../base_rk3328.seed cat ../base_rk3328.seed > configs/config_rk3328 echo '# CONFIG_V2RAY_COMPRESS_UPX is not set' >> 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/lede && git fetch upstream git rebase adc1a9a3676b8d7be1b48b5aed185a94d8e42728^ --onto upstream/master -X theirs git revert --no-edit f092ca098e80c667b10cdd1dba328506a2673c1d git checkout upstream/master -- feeds.conf.default cd package/lean/ #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 '/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 echo -e '\nDYC Build\n' >> package/base-files/files/etc/banner - 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/ zip -r artifact.zip ./artifact/ release_tag="R2S-Lean-$(date +%Y-%m-%d)" 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