MI-NANO #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#修改TNAME: K2P 中的K2P为你需要编译的型号,注意名称要与configs/templates/目录下的名字相同 | |
name: Build Padavan | |
on: | |
release: | |
types: [published] | |
push: | |
tags: | |
- 'v*' | |
# branches: | |
# - master | |
# schedule: | |
# - cron: 0 8 * * 5 | |
watch: | |
types: [started] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install unzip libtool-bin curl cmake gperf gawk flex bison nano xxd fakeroot \ | |
cpio git python-docutils gettext automake autopoint texinfo build-essential help2man \ | |
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget | |
- name: Clone source code | |
env: | |
KERNEL: 3.4 | |
run: | | |
if [ $KERNEL = "4.4" ] ; then | |
git clone --depth=1 https://github.com/MeIsReallyBa/padavan-4.4.git /opt/rt-n56u | |
else | |
git clone --depth=1 https://github.com/liqideqq/rt-n56u.git /opt/rt-n56u | |
fi | |
cd /opt/rt-n56u/toolchain-mipsel | |
sh dl_toolchain.sh | |
mkdir -p /opt/images/ | |
- name: Build Firmware | |
env: | |
TNAME: MI-NANO | |
KERNEL: 3.4 | |
run: | | |
cd /opt/rt-n56u/trunk | |
if [ ! -f configs/templates/$TNAME.config ] ; then | |
echo "configs/templates/$TNAME.config not found " | |
exit 1 | |
fi | |
cp -f configs/templates/$TNAME.config .config | |
sed -i 's/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=n/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=y/g' .config | |
sudo ./clear_tree | |
sudo ./build_firmware_modify $TNAME 0 | |
sudo mv -f images/*.trx /opt/images/ | |
- name : Upload packages | |
uses: actions/upload-artifact@master | |
if: always() | |
with: | |
name: Padavan-packages | |
path: /opt/images |