-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
92 additions
and
21 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: K2P_nano_4.4 | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
env: | ||
IMAGE_DIR: /opt/images | ||
runs-on: ubuntu-20.04 | ||
if: ${{ contains(github.ref, '-k4') }} | ||
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-4.4.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 |