Files
nanopi-openwrt-r1s-h3/.github/workflows/r1s_lean.yml
2020-09-05 17:04:05 +08:00

91 lines
3.7 KiB
YAML

name: r1s Lean版openwrt
on:
push:
branches: [ master ]
paths:
- '.github/workflows/r1s_lean.yml'
schedule:
- cron: '10 10 */4 * *'
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_rouce.sh master h5
- name: Mods
run: |
cd friendlywrt-h5
. ../remove_unused_config.sh
cat ../app_config.seed >> configs/config_h5
echo '# CONFIG_V2RAY_COMPRESS_UPX is not set' >> configs/config_h5
cd friendlywrt
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 master
git rebase 90bb1cf9c33e73de5019686b8bd495f689e675a4^ --onto tmp -X theirs
rm -f target/linux/allwinner-h5/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
git checkout upstream/lede-17.01 -- feeds.conf.default
sed -i -E 's/#(src-git.+)(helloworld.+)/\1\2/' feeds.conf.default
cd package/lean/
rm -rf luci-theme-argon
. ../../../../3_prepare_packages.sh
cd ../../
git apply ../../enable_autocore.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
echo -e '\nDYC Build\n' >> package/base-files/files/etc/banner
- name: Build FriendlyWrt
run: . 4_build_image.sh friendlywrt-h5 nanopi_r1s.mk
- name: Assemble Artifact
id: assemble_artifact
run: |
. x_assemble_artifact.sh
release_tag="R1S-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