OpenWrt-CI #917
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
# | |
# <https://github.com/KFERMercer/OpenWrt-CI> | |
# | |
# Copyright (C) 2019 P3TERX | |
# | |
# Copyright (C) 2020 KFERMercer | |
# | |
# | |
# <https://github.com/KFERMercer/OpenWrt-CI> | |
# | |
# Copyright (C) 2019 P3TERX | |
# | |
# Copyright (C) 2020 KFERMercer | |
# | |
name: OpenWrt-CI | |
on: | |
schedule: | |
- cron: 0 20 * * * | |
release: | |
types: [published] | |
repository_dispatch: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build_openwrt: | |
permissions: | |
contents: write # for release creation | |
name: Build OpenWrt firmware | |
runs-on: ubuntu-latest | |
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: stable | |
- name: Space cleanup | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
docker rmi `docker images -q` | |
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android | |
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* adoptopenjdk* mysql* php* mongodb* dotnet* moby* snapd* || true | |
sudo -E apt-get update | |
sudo -E apt-mark hold grub-efi-amd64-signed | |
sudo -E apt-get -y install ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev | |
pip3 install pyelftools | |
sudo -E apt-get -y autoremove --purge | |
sudo -E apt-get clean | |
df -h | |
- name: Update feeds | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a -f | |
echo ' | |
CONFIG_TARGET_rockchip=y | |
CONFIG_TARGET_rockchip_armv8=y | |
CONFIG_TARGET_MULTI_PROFILE=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_doornet1=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_doornet2=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-1=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-1n=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-2=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-2n=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-4=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_embedfire_lubancat-5=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopc-t6=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2c=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4s=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r4se=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r5c=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r5s=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r6c=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r6s=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_hinlink_h88k=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_hinlink_opc-h66k=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_hinlink_opc-h68k=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_hinlink_opc-h69k=y | |
CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_zero-3e=y | |
CONFIG_TARGET_KERNEL_PARTSIZE=64 | |
CONFIG_TARGET_ROOTFS_PARTSIZE=512 | |
CONFIG_TARGET_ROOTFS_TARGZ=y | |
CONFIG_TARGET_ROOTFS_EXT4FS=y | |
CONFIG_TARGET_ROOTFS_SQUASHFS=y | |
' >> .config | |
- name: Generate configuration file | |
run: make defconfig | |
- name: Make download | |
run: | | |
make download -j8 | |
find dl -size -1024c -exec rm -f {} \; | |
- name: Compile firmware | |
run: | | |
make -j$(nproc) || make -j1 V=s | |
echo "=======================" | |
echo "Space usage:" | |
echo "=======================" | |
df -h | |
echo "=======================" | |
du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin | |
du -h --max-depth=1 ./build_dir | |
du -h --max-depth=1 ./bin | |
- name: Prepare artifact | |
run: | | |
mkdir -p ./artifact/firmware | |
mkdir -p ./artifact/package | |
mkdir -p ./artifact/buildinfo | |
rm -rf $(find ./bin/targets/ -type d -name "packages") | |
cp -rf $(find ./bin/targets/ -type f) ./artifact/firmware/ | |
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/ | |
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/ | |
- name: Deliver buildinfo | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OpenWrt_buildinfo | |
path: ./artifact/buildinfo/ | |
- name: Deliver package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OpenWrt_package | |
path: ./artifact/package/ | |
- name: Deliver firmware | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OpenWrt_firmware | |
path: ./bin/targets/ | |
- name: Upload release asset | |
if: github.event == 'release' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.YOURTOKEN }} | |
file: ./artifact/firmware/* | |
tag: ${{ github.ref }} | |
file_glob: true |