Skip to content

t7

t7 #2

Workflow file for this run

name: t7
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
env:
REPO_URL: https://github.com/hanwckf/immortalwrt-mt798x
REPO_BRANCH: openwrt-21.02
FEEDS_CONF: feeds.conf.default
CONFIG_FILE: .config
TZ: Asia/Shanghai
DEVICE: 360t7
UPLOAD_OUTPUT: true
UPLOAD_RELEASE: true
jobs:
build:
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: 配置
uses: actions/checkout@master
- name: 配置环境
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install ack neofetch 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
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
sudo -E apt-get -qq install build-essential asciidoc binutils bzip2 curl gawk gettext git libncurses5-dev libz-dev patch python3.5 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf
sudo -E apt-get -qq install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache clang clangd cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev libssl-dev libtool lld lldb lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply python-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
- name: 克隆源码
working-directory: /workdir
run: |
df -hT $PWD
git clone $REPO_URL -b $REPO_BRANCH openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
# - name: 配置 Feeds
# run: |
# cp -f $GITHUB_WORKSPACE/.config $GITHUB_WORKSPACE/openwrt/
# cd openwrt
# echo "src-git kenzo https://github.com/kenzok8/openwrt-packages" >> ./feeds.conf.default
# echo "src-git small https://github.com/kenzok8/small" >> ./feeds.conf.default
# ./scripts/feeds update -a
# ./scripts/feeds install -a
# cp -f $GITHUB_WORKSPACE/.config $GITHUB_WORKSPACE/openwrt/
# ./scripts/feeds install -a
# - name: 修改 Lan IP
# run: |
# cd openwrt
# sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
# neofetch
# - name: 下载依赖
# run: |
# cd openwrt
# make defconfig
# make download -j8
# find dl -size -1024c -exec ls -l {} \;
# find dl -size -1024c -exec rm -f {} \;
# - name: 编译固件
# run: |
# cd openwrt
# make -j$(nproc)
# echo "FILE_DATE=$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name : 上传输出文件
uses: actions/upload-artifact@master
if: env.UPLOAD_OUTPUT == 'true' && !cancelled()
with:
name: ${{ env.DEVICE }}--${{ env.FILE_DATE }}
path: openwrt/bin
- name: 整理输出文件
run: |
cd openwrt/bin/targets/*/*
rm -rf packages
- name: 发布固件至 Release
uses: ncipollo/release-action@v1
with:
tag: "${{ env.DEVICE }}--${{ env.FILE_DATE }}"
artifacts: "openwrt/bin/targets/*/*/*"
# body: |
# # 未测试×
# IP: 192.168.2.1 | Password: none