X-OpenWrt/.github/workflows/AutoBuild.yml

85 lines
2.0 KiB
YAML
Raw Normal View History

2020-09-08 03:23:08 +00:00
#=================================================
# Description: Build OpenWrt using GitHub Actions
# Lisence: MIT
# Author: P3TERX,eSirPlayground
# Modify: Hyy2001
#=================================================
name: AutoBuild
on:
release:
types: [published]
#push:
# branches:
# - master
#schedule:
# - cron: 0 8 * * 5
watch:
types: [started]
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: .config
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
- name: Clone source code
run: |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt
cd openwrt
sed -i "s/#src-git helloworld/src-git helloworld/g" feeds.conf.default
- name: Update & Install feeds
run: |
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
./scripts/feeds install -a
- name: Configuration Customization - AutoBuild
run: |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x ./customize.sh && ./customize.sh
cd openwrt
- name: Download package
run: |
cd openwrt
make defconfig
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Build firmware
working-directory: ./openwrt
run: |
echo -e "$(nproc) thread build."
make -j$(nproc) V=s
- name : Upload artifact
uses: actions/upload-artifact@master
with:
name: OpenWrt
path: openwrt/bin