# # This is free software, lisence use MIT. # # Copyright (C) 2019 P3TERX # Copyright (C) 2019 KFERMercer # # # name: OpenWrt-CI on: schedule: - cron: 0 20 * * * jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@master with: ref: master - 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 sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* sudo -E apt-get update sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler sudo -E apt-get -y autoremove --purge sudo -E apt-get clean # 利用挂载在 /mnt/ 的 14G 额外空间: # sudo mkdir -p -m 777 /mnt/openwrt/bin /mnt/openwrt/build_dir/host /mnt/openwrt/build_dir/hostpkg /mnt/openwrt/dl /mnt/openwrt/feeds /mnt/openwrt/staging_dir # ln -s /mnt/openwrt/bin ./bin # mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/host ./build_dir/host # mkdir -p ./build_dir/host && ln -s /mnt/openwrt/build_dir/hostpkg ./build_dir/hostpkg # ln -s /mnt/openwrt/dl ./dl # ln -s /mnt/openwrt/feeds ./feeds # ln -s /mnt/openwrt/staging_dir ./staging_dir df -h - name: Update feeds run: | ./scripts/feeds update -a ./scripts/feeds install -a - 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: find ./bin/targets/ -type d -name "packages" | xargs rm -rf {} - name: Upload artifact uses: actions/upload-artifact@master with: name: OpenWrt firmware path: ./bin/targets/