Skip to content

v20240219-k3-k4-1

v20240219-k3-k4-1 #16

Workflow file for this run

name: K2P_nano
on:
release:
types: [published]
jobs:
build:
permissions:
contents: write
env:
IMAGE_DIR: /opt/images
runs-on: ubuntu-20.04
if: ${{ contains(github.ref, '-k3') }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare environment
run: |
mkdir -p ${IMAGE_DIR}
sudo apt update
sudo apt install libtool-bin gperf python-docutils autopoint gettext
- name: Checkout rt-n56u
run: |
git clone --depth=1 https://github.com/undoubted/Padavan-KVR.git rt-n56u
- name: Prepare toolchain
run: |
cd ./rt-n56u/toolchain-mipsel
sh dl_toolchain.sh
- name: Build images
run: |
cd ./rt-n56u/trunk
sed -i 's/CONFIG_FIRMWARE_INCLUDE_CURL=y/CONFIG_FIRMWARE_INCLUDE_CURL=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NAPT66=y/CONFIG_FIRMWARE_INCLUDE_NAPT66=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_VLMCSD=y/CONFIG_FIRMWARE_INCLUDE_VLMCSD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_TTYD=y/CONFIG_FIRMWARE_INCLUDE_TTYD=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_HTOP=y/CONFIG_FIRMWARE_INCLUDE_HTOP=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_NANO=y/CONFIG_FIRMWARE_INCLUDE_NANO=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_IPERF3=y/CONFIG_FIRMWARE_INCLUDE_IPERF3=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MTR=y/CONFIG_FIRMWARE_INCLUDE_MTR=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SOCAT=y/CONFIG_FIRMWARE_INCLUDE_SOCAT=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_SRELAY=y/CONFIG_FIRMWARE_INCLUDE_SRELAY=n/' configs/templates/K2P_nano.config
sed -i 's/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=y/CONFIG_FIRMWARE_INCLUDE_MSD_LITE=n/' configs/templates/K2P_nano.config
for i in {0..1}; do
if [ "$i" -eq "1" ]; then
sed -i 's/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=n/CONFIG_FIRMWARE_INCLUDE_ZEROTIER=y/' build_firmware_modify
fi
fakeroot ./build_firmware_modify K2P_nano
for f in images/*.trx; do
if [ "$i" -eq "1" ]; then
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx)_zerotier.trx"
else
cp -v -- "$f" "$IMAGE_DIR/$(basename $f .trx).trx"
fi
done
rm -rf images/*
done
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{ env.IMAGE_DIR }}/*.trx