Skip to content

x86_64-mini

x86_64-mini #1269

Workflow file for this run

name: x86_64-mini
on:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
schedule:
- cron: '0 21 * * *'
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: x86_64/x86_64-mini.config
DIY_P1_SH: x86_64/diy-part1.sh
DIY_P2_SH: x86_64/diy-part2.sh
UPLOAD_FIRMWARE_DIR: true
UPLOAD_RELEASE: true
FIRMWARE_TYPE: x86_64-mini
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: SSH Connection To Actions
uses: P3TERX/[email protected]
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
- name: Free Disk Space
uses: endersonmenezes/free-disk-space@main
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
remove_tool_cache: true
remove_swap: true
remove_packages: "android* azure* clang* dotnet* firefox* ghc* golang* google* libclang* libgl1* \
lld* llvm* microsoft* mongodb* mono* mysql* nodejs* openjdk* php* postgresql* powershell* snap* temurin* yarn* zulu*"
remove_packages_one_command: true
remove_folders: "/etc/apt/sources.list.d* /etc/mono* /etc/mysql* /usr/include/linux/android* /usr/lib/llvm* /usr/lib/mono* \
/usr/local/lib/android* /usr/local/lib/node_modules* /usr/local/share/chromium* /usr/local/share/powershell* /usr/local/share/vcpkg/ports/azure* \
/usr/local/share/vcpkg/ports/google* /usr/local/share/vcpkg/ports/libpq/android* /usr/local/share/vcpkg/ports/llvm* /usr/local/share/vcpkg/ports/mysql* \
/usr/local/share/vcpkg/ports/snap* /usr/share/azure* /usr/share/dotnet* /usr/share/glade* /usr/share/miniconda* /usr/share/php* /usr/share/swift \
/var/lib/mysql* /var/log/azure*"
testing: false
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi $(docker images -q)
sudo -E apt -yqq update
sudo -E apt -yqq full-upgrade
sudo -E apt -yqq install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache clang cmake cpio curl device-tree-compiler flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool llvm lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
sudo -E apt -yqq autoremove --purge
sudo -E apt -yqq clean
sudo -E systemctl daemon-reload
sudo -E timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
- name: Hard Drive Capacity(Before Compile)
if: (!cancelled())
run: df -hT
- name: Clone Openwrt Source Code
working-directory: /workdir
run: |
git clone $REPO_URL -b $REPO_BRANCH openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
- name: Diy Part 1 SH
run: |
chmod +x $DIY_P1_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P1_SH ${{ secrets.RELEASES_TOKEN }}
- name: Update Feeds
run: cd openwrt && ./scripts/feeds update -a
- name: Install Feeds
run: cd openwrt && ./scripts/feeds install -a
- name: Load Custom Configuration
run: |
[ -e files ] && mv files openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
- name: Diy Part 2 SH
run: |
chmod +x $DIY_P2_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_P2_SH
- name: Download Package
id: package
run: |
cd openwrt
make defconfig
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Compile The Firmware
id: compile
run: |
cd openwrt
make V=s -j$(nproc)
echo "status=success" >> $GITHUB_OUTPUT
grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME
[ -s DEVICE_NAME ] && echo "DEVICE_NAME=$(cat DEVICE_NAME)" >> $GITHUB_ENV
COMPLITE_TIME=$(date "+%Y-%m-%d %H:%M:%S")
TAG_TIME=$(date -d "$COMPLITE_TIME" "+%Y%m%d-%H%M%S")
echo "COMPLITE_TIME=$COMPLITE_TIME" >> $GITHUB_ENV
echo "TAG_TIME=$TAG_TIME" >> $GITHUB_ENV
echo "FILE_TIME=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Hard Drive Capacity(After Compile)
if: (!cancelled())
run: df -hT
- name: Organize Files
id: organize
run: |
cd openwrt/bin/targets/*/*
rm -rf packages
rm -rf sha256sums
rm -rf *.buildinfo
rm -rf *.manifest
rm -rf *.json
rm -rf *kernel.bin
rm -rf *rootfs.img.gz
# find ./ ! -regex ".*\.img\|.*\.vmdk\|.*\.bin\|./" -exec rm {} \;
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "status=success" >> $GITHUB_OUTPUT
- name: Upload Firmware To Release
id: release
uses: ncipollo/release-action@main
with:
name: ${{ env.COMPLITE_TIME }} Openwrt for ${{ env.FIRMWARE_TYPE }}
tag: ${{ env.FIRMWARE_TYPE }}-${{ env.TAG_TIME }}
commit: main
token: ${{ secrets.RELEASES_TOKEN }}
body: |
默认IP:192.168.1.1 默认密码: password
当前使用版本:【编译前的最后一次[Lean's OpenWrt](https://github.com/coolsnowwolf/lede)更新记录】
artifacts: ${{ env.FIRMWARE }}/*