-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 2.83 KB
/
k2p_nano.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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