2020-09-11 02:08:22 +00:00
|
|
|
#=======================================================
|
2020-09-08 03:23:08 +00:00
|
|
|
# Description: Build OpenWrt using GitHub Actions
|
2020-09-11 01:37:13 +00:00
|
|
|
# Github: https://github.com/Hyy2001X/AutoBuild-Actions
|
2020-09-08 03:23:08 +00:00
|
|
|
# Lisence: MIT
|
2020-09-11 01:34:26 +00:00
|
|
|
# Author: P3TERX
|
2020-09-08 03:23:08 +00:00
|
|
|
# Modify: Hyy2001
|
2020-09-11 02:08:22 +00:00
|
|
|
#=======================================================
|
2020-09-08 03:23:08 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
name: AutoBuild OpenWrt
|
2020-09-08 03:23:08 +00:00
|
|
|
|
|
|
|
on:
|
2020-09-11 01:34:26 +00:00
|
|
|
# release:
|
|
|
|
# types: [published]
|
2020-09-08 03:23:08 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
# push:
|
|
|
|
# branches:
|
|
|
|
# - main
|
2020-09-08 03:23:08 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
# schedule:
|
|
|
|
# - cron: 0 8 * * 5
|
2020-09-08 03:23:08 +00:00
|
|
|
|
|
|
|
watch:
|
|
|
|
types: [started]
|
|
|
|
|
|
|
|
env:
|
|
|
|
REPO_URL: https://github.com/coolsnowwolf/lede
|
2020-09-11 01:58:40 +00:00
|
|
|
REPO_BRANCH: master
|
2020-09-08 03:23:08 +00:00
|
|
|
CONFIG_FILE: .config
|
2020-09-11 01:49:57 +00:00
|
|
|
FEEDS_CONF_DEFAULT: ./Customize/feeds.conf.default
|
|
|
|
MAC80211: ./Customize/mac80211.sh
|
|
|
|
MWAN3: ./Customize/mwan3
|
2020-09-16 15:18:30 +00:00
|
|
|
CUSTOM_SCRIPT: ./Scripts/diy-script.sh
|
2020-09-11 01:34:26 +00:00
|
|
|
TZ: Asia/Shanghai
|
2020-09-08 03:23:08 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-09-11 01:34:26 +00:00
|
|
|
runs-on: ubuntu-18.04
|
2020-09-08 03:23:08 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-09-11 01:34:26 +00:00
|
|
|
uses: actions/checkout@main
|
2020-09-08 03:23:08 +00:00
|
|
|
|
|
|
|
- name: Initialization environment
|
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
|
|
|
run: |
|
2020-09-11 01:34:26 +00:00
|
|
|
sudo -E apt-get update
|
2020-09-13 14:11:49 +00:00
|
|
|
sudo -E apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 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 g++-multilib antlr3 gperf wget curl swig rsync
|
2020-09-08 03:23:08 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Clone OpenWRT source code
|
2020-09-08 03:23:08 +00:00
|
|
|
run: |
|
2020-09-11 01:34:26 +00:00
|
|
|
git clone -b $REPO_BRANCH $REPO_URL openwrt
|
|
|
|
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
|
2020-09-11 01:37:13 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Run Before-Update-Feeds Script
|
|
|
|
run: |
|
|
|
|
[ -e $FEEDS_CONF_DEFAULT ] && mv $FEEDS_CONF_DEFAULT openwrt/feeds.conf.default
|
2020-09-16 15:18:30 +00:00
|
|
|
chmod +x $CUSTOM_SCRIPT
|
2020-09-11 01:34:26 +00:00
|
|
|
cd openwrt
|
2020-09-16 15:18:30 +00:00
|
|
|
source $GITHUB_WORKSPACE/$CUSTOM_SCRIPT && Diy_Core && Diy-Part1
|
2020-09-11 01:37:13 +00:00
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Update & Install Feeds
|
2020-09-08 03:23:08 +00:00
|
|
|
run: |
|
|
|
|
cd openwrt
|
|
|
|
./scripts/feeds update -a
|
|
|
|
./scripts/feeds install -a
|
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Run After-Update-Feeds Script
|
2020-09-08 03:23:08 +00:00
|
|
|
run: |
|
2020-09-11 01:34:26 +00:00
|
|
|
[ -e $MAC80211 ] && mv $MAC80211 openwrt/package/kernel/mac80211/files/lib/wifi/mac80211.sh
|
|
|
|
[ -e $MWAN3 ] && mv $MWAN3 openwrt/package/feeds/packages/mwan3/files/etc/config/mwan3
|
2020-09-08 03:23:08 +00:00
|
|
|
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
|
|
|
|
cd openwrt
|
2020-09-16 15:18:30 +00:00
|
|
|
source $GITHUB_WORKSPACE/$CUSTOM_SCRIPT && Diy_Core && Diy-Part2
|
2020-09-11 01:37:13 +00:00
|
|
|
|
2020-09-08 03:23:08 +00:00
|
|
|
- name: Download package
|
|
|
|
run: |
|
2020-09-11 01:53:27 +00:00
|
|
|
cd openwrt
|
2020-09-11 01:34:26 +00:00
|
|
|
make download -j$(nproc)
|
2020-09-08 03:23:08 +00:00
|
|
|
find dl -size -1024c -exec ls -l {} \;
|
|
|
|
find dl -size -1024c -exec rm -f {} \;
|
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Compile the firmware
|
2020-09-08 03:23:08 +00:00
|
|
|
run: |
|
2020-09-11 01:53:27 +00:00
|
|
|
cd openwrt
|
2020-09-08 03:23:08 +00:00
|
|
|
make -j$(nproc) V=s
|
|
|
|
|
2020-09-11 01:34:26 +00:00
|
|
|
- name: Run After-Compile-OpenWRT Script
|
|
|
|
run: |
|
|
|
|
cd openwrt
|
2020-09-16 15:18:30 +00:00
|
|
|
source $GITHUB_WORKSPACE/$CUSTOM_SCRIPT && Diy_Core && Diy-Part3
|
2020-09-11 01:34:26 +00:00
|
|
|
|
2020-09-11 01:53:27 +00:00
|
|
|
- name: Upload Firmware to Artifact
|
2020-09-11 01:34:26 +00:00
|
|
|
uses: actions/upload-artifact@main
|
2020-09-08 03:23:08 +00:00
|
|
|
with:
|
|
|
|
name: OpenWrt
|
2020-09-11 01:34:26 +00:00
|
|
|
path: openwrt/bin/Firmware
|