Hanwckf Padavan Nano #81
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
name: Hanwckf Padavan Nano | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
watch: | |
types: started | |
env: | |
REPO_URL: https://github.com/meisreallyba/padavan-4.4.git | |
REPO_BRANCH: main | |
DIY_P1_SH: mod.sh | |
TZ: Asia/Shanghai | |
images_dir: /opt/images | |
targets: "B70 BELL-A040WQ CR660x DIR-878 DIR-882 JCG-836PRO JCG-AC860M JCG-Q20 JCG-Y2 JDCLOUD-RE-CP-02 JDCLOUD-RE-SP-01B K2P_nano MI-4 MI-R3G MI-R3P-PB MI-R3P MR2600 MSG1500 NETGEAR-BZV NEWIFI R2100 RM2100 RT-AC85P WR1200JS XY-C1 ZTE-E8820S" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Prepare environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install libtool-bin gperf python3-docutils autopoint gettext | |
sudo timedatectl set-timezone "$TZ" | |
- name: Clone source code | |
run: | | |
git clone $REPO_URL /opt/padavan-4.4 | |
- name: Prepare toolchain | |
run: | | |
cd /opt/padavan-4.4/toolchain-mipsel | |
sh dl_toolchain.sh | |
- name: Load custom configuration | |
run: | | |
chmod +x $DIY_P1_SH | |
[ -e $DIY_P1_SH ] && mv $DIY_P1_SH /opt/padavan-4.4/trunk | |
- name: Compile the firmware | |
run: | | |
cd /opt/padavan-4.4/trunk | |
sh mod.sh | |
mkdir -p ${images_dir} | |
for m in $targets; do fakeroot ./build_firmware_ci $m; \ | |
if [ $? = 0 ]; then cp -f images/*.trx ${images_dir}/$m.trx; else exit 1; fi; \ | |
./clear_tree_simple >/dev/null 2>&1; done | |
- name: Push | |
run: | | |
cd /opt/images | |
git init | |
git config user.name "一支穿云箭" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "$(date "+%Y-%m-%d %H:%M")~千军万马来相见!" -a | |
${{ secrets.test }} | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@main | |
with: | |
retain_days: 1 | |
keep_minimum_runs: 3 |