imagebuilder编译24.10.0_rc1 #3
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
name: imagebuilder编译24.10.0_rc1 | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
inputs: | |
ssh: | |
description: 'SSH connection to Actions' | |
required: false | |
default: 'false' | |
schedule: | |
- cron: "20 3 * * 1" | |
env: | |
TZ: Asia/Shanghai | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 删除文件 | |
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 -y autoremove --purge | |
sudo -E apt-get clean | |
sudo timedatectl set-timezone "$TZ" | |
- name: 显示系统情况 | |
run: | | |
lscpu | |
free -h | |
df -Th | |
uname -a | |
echo "TIME1=$(date "+%Y年%m月%d日%H时%M分")" >> $GITHUB_ENV | |
- name: 安装依赖文件 | |
run: | | |
sudo -E apt update -y | |
sudo -E apt install -y ack antlr3 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-pyelftools \ | |
libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip zstd \ | |
vim wget xmlto xxd zlib1g-dev python3-setuptools | |
- name: 下载imagebuilder源码 | |
run: | | |
wget https://downloads.immortalwrt.org/releases/24.10.0-rc1/targets/x86/64/immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64.tar.zst | |
tar -I zstd -x -f immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64.tar.zst | |
- name: 修改配置和编译文件 | |
run: | | |
cd immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64 | |
#sed -i 's/CONFIG_ISO_IMAGES=y/#CONFIG_ISO_IMAGES is not set/' .config | |
sed -i 's/CONFIG_QCOW2_IMAGES=y/#CONFIG_QCOW2_IMAGES is not set/' .config | |
sed -i 's/CONFIG_VDI_IMAGES=y/#CONFIG_VDI_IMAGES is not set/' .config | |
sed -i 's/CONFIG_VMDK_IMAGES=y/#CONFIG_VDI_IMAGES is not set/' .config | |
sed -i 's/CONFIG_VHDX_IMAGES=y/#CONFIG_VHDX_IMAGES is not set/' .config | |
sed -i 's/CONFIG_TARGET_ROOTFS_PARTSIZE=300/CONFIG_TARGET_ROOTFS_PARTSIZE=1024/' .config | |
- name: 添加非官方包 | |
run: | | |
cd immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64 | |
wget -P ./packages https://github.com/gdy666/luci-app-lucky/releases/download/v2.14.0/luci-app-lucky_2.1.1-1_all.ipk | |
wget -P ./packages https://github.com/gdy666/luci-app-lucky/releases/download/v2.14.0/luci-i18n-lucky-zh-cn_2.1.1-1_all.ipk | |
wget -P ./packages https://github.com/gdy666/luci-app-lucky/releases/download/v2.14.0/lucky_2.14.0_Openwrt_x86_64.ipk | |
wget -P ./packages https://github.com/tty228/luci-app-wechatpush/releases/download/v3.5.6/luci-app-wechatpush_3.5.6_all.ipk | |
wget -P ./packages https://github.com/tty228/luci-app-wechatpush/releases/download/v3.5.6/luci-i18n-wechatpush-zh-cn_24.195.32270.071b978_all.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/mosdns_5.3.3-2_x86_64.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/v2dat_2022-12-15-47b8ee51-1_x86_64.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/v2ray-geoip_2024-10-03-1_all.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/v2ray-geosite_2024-10-03-1_all.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/luci-app-mosdns_1.6.6_all.ipk | |
wget -P ./packages https://github.com/sbwml/luci-app-mosdns/releases/download/v5.3.3-2/luci-i18n-mosdns-zh-cn_git-24.246.09619-49e5a0d_all.ipk | |
- name: 编译 | |
id: compile | |
run: | | |
cd immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64 | |
make image PACKAGES="qemu-ga bind-host luci-i18n-smartdns-zh-cn luci-app-openclash luci-app-ddns-go luci-i18n-zerotier-zh-cn luci-i18n-ttyd-zh-cn luci-i18n-attendedsysupgrade-zh-cn luci-i18n-opkg-zh-cn luci-i18n-ddns-zh-cn ddns-scripts-dnspod luci-i18n-upnp-zh-cn luci-i18n-firewall-zh-cn luci-i18n-vlmcsd-zh-cn luci-i18n-arpbind-zh-cn luci-i18n-base-zh-cn luci-i18n-passwall-zh-cn ddns-scripts-cloudflare ddns-scripts_aliyun luci-i18n-udpxy-zh-cn luci-i18n-ddns-go-zh-cn luci-i18n-watchcat-zh-cn luci-app-wechatpush luci-i18n-wechatpush-zh-cn lucky luci-app-lucky luci-i18n-lucky-zh-cn v2dat v2ray-geoip v2ray-geosite mosdns luci-app-mosdns luci-i18n-mosdns-zh-cn luci-i18n-wol-zh-cn luci-i18n-homeproxy-zh-cn luci-proto-wireguard" echo "FILE_DATE=_$(date +"%Y%m%d-%H%M")" >> $GITHUB_ENV | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: 整理文件 | |
id: organize | |
run: | | |
cd immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64/bin/targets/*/* | |
echo "FIRMWARE=$PWD" >> $GITHUB_ENV | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: 上传firmware文件夹 | |
uses: actions/upload-artifact@main | |
if: steps.organize.outputs.status == 'success' && !cancelled() | |
with: | |
name: immortalwrt-imagebuilder-24.10.0-rc1-x86-64.Linux-x86_64-${{ env.FILE_DATE }} | |
path: ${{ env.FIRMWARE }} | |
- name: 创建 release 标签 | |
id: tag | |
run: | | |
echo "release_tag=imagebuilder-24.10.0-rc1-x86-64-${{ env.FILE_DATE }}" >> $GITHUB_OUTPUT | |
touch release.txt | |
echo "TIME2=$(date "+%Y年%m月%d日%H时%M分")" >> $GITHUB_ENV | |
echo "status=success" >> $GITHUB_OUTPUT | |
- name: 上传发布release | |
uses: softprops/action-gh-release@v1 | |
if: steps.tag.outputs.status == 'success' && !cancelled() | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TRIGGER_PAT }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
body_path: release.txt | |
files: ${{ env.FIRMWARE }}/* | |
- name: 删除运行的工作流 | |
uses: naoki66/delete-workflow-runs@main | |
with: | |
retain_days: 1 | |
keep_minimum_runs: 3 | |
- name: 删除旧RReleases | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 6 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TRIGGER_PAT }} | |
- name: Pushplus推送通知 | |
if: steps.tag.outputs.status == 'success' && !cancelled() | |
run: curl http://www.pushplus.plus/send -X POST -H "Content-Type:application/json" -d '{"title":"imagebuilder编译immortalwrt-24.10.0-rc1-x86-64成功!","content":" 从${{ env.TIME1 }}开始到${{ env.TIME2 }}编译完成!","token":"${{ secrets.PUSHPLUS_TOKEN }}","webhook":"02","channel":"cp"}' |