Create r1s_lean_h3.yml
This commit is contained in:
153
.github/workflows/r1s_lean_h3.yml
vendored
Normal file
153
.github/workflows/r1s_lean_h3.yml
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
name: r1s Lean版openwrt
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/r1s_lean_h3.yml'
|
||||
schedule:
|
||||
- cron: '10 10 */2 * *'
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
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 install bc build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler
|
||||
wget -O - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | bash
|
||||
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-h3
|
||||
cd friendlywrt-h3
|
||||
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master -m h5.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle
|
||||
repo sync -c --no-clone-bundle -j8
|
||||
|
||||
- name: Mods
|
||||
run: |
|
||||
cd friendlywrt-h3
|
||||
. ../remove_unused_config.sh
|
||||
cat ../app_config.seed >> configs/config_h3
|
||||
echo '# CONFIG_V2RAY_COMPRESS_UPX is not set' >> configs/config_h3
|
||||
sed -i '/docker/Id;/containerd/Id;/runc/Id;/iptparser/Id' configs/config_h3 #fix compile error
|
||||
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 90bb1cf9c33e73de5019686b8bd495f689e675a4^ --onto upstream/master -X theirs
|
||||
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
|
||||
#dnsmasq.ssr/gfw_list.conf' | xargs rm
|
||||
#cd ../../../
|
||||
rm -rf luci-theme-argon
|
||||
git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git
|
||||
cd ../../
|
||||
sed -i '/exit/i\mv /etc/rc.d/S25dockerd /etc/rc.d/S92dockerd && sed -i "s/START=25/START=92/g" S92dockerd' package/lean/default-settings/files/zzz-default-settings
|
||||
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 '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
|
||||
echo -e '\nDYC Build\n' >> package/base-files/files/etc/banner
|
||||
|
||||
- name: Mod luci
|
||||
run: |
|
||||
cd friendlywrt-h3/friendlywrt
|
||||
./scripts/feeds update -a && ./scripts/feeds install -a
|
||||
sed -i '/Load Average/i\<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("cut -c1-2 /sys/class/thermal/thermal_zone0/temp")%></td></tr>' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
|
||||
sed -i 's/pcdata(boardinfo.system or "?")/"ARMv8"/' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
|
||||
|
||||
- name: Build FriendlyWrt
|
||||
run: |
|
||||
cd friendlywrt-h3
|
||||
cp configs/config_h3 friendlywrt/.config
|
||||
cd friendlywrt
|
||||
make defconfig && make download -j8
|
||||
make -s -j$(nproc) || make V=s -j1
|
||||
|
||||
#- name: Patch Kernel
|
||||
# run: |
|
||||
# cd friendlywrt-h5
|
||||
# #cd kernel/ && git apply ../../add_fullconenat.diff && cd ../
|
||||
# git clone https://github.com/openwrt/openwrt
|
||||
# cd openwrt/
|
||||
# git checkout 5387bc9cbb9ed205f08766523a296f21dfa83b56
|
||||
# rm target/linux/generic/backport-4.14/400-v4.16-leds-trigger-Introduce-a-NETDEV-trigger.patch
|
||||
# rm target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch
|
||||
# rm target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch
|
||||
# ./scripts/patch-kernel.sh ../kernel target/linux/generic/backport-4.14
|
||||
# ./scripts/patch-kernel.sh ../kernel target/linux/generic/pending-4.14
|
||||
# ./scripts/patch-kernel.sh ../kernel target/linux/generic/hack-4.14
|
||||
# cd ../kernel && git checkout -- drivers/mtd/ && cd ../
|
||||
# find friendlywrt/ -type f -name .config.override -exec cp {} ../ \;
|
||||
# grep -i 'FILTER_\|FLOW' ../.config.override > .config.override
|
||||
# wget https://github.com/torvalds/linux/raw/master/scripts/kconfig/merge_config.sh && chmod +x merge_config.sh
|
||||
# ./merge_config.sh -m .config.override kernel/arch/arm64/configs/sunxi_arm64_defconfig && mv .config kernel/arch/arm64/configs/sunxi_arm64_defconfig
|
||||
|
||||
- name: Build SD img
|
||||
run: |
|
||||
cd friendlywrt-h3
|
||||
sed -i '130,150 {/build_friendlywrt/d}' scripts/build.sh
|
||||
./build.sh nanopi_r1s.mk
|
||||
|
||||
- name: Zip Files
|
||||
run: |
|
||||
gzip friendlywrt-h3/out/*.img
|
||||
- name: Assemble Artifact
|
||||
id: assemble_artifact
|
||||
run: |
|
||||
rm -rf ./artifact/
|
||||
mkdir -p ./artifact/
|
||||
mv friendlywrt-h3/out/*img* ./artifact/
|
||||
cp friendlywrt-h3/friendlywrt/.config ./artifact/
|
||||
zip -r artifact.zip ./artifact/
|
||||
release_tag="R1S-H3-$(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
|
||||
Reference in New Issue
Block a user