forked from FunctionXJB/Build-Openwrt
-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (119 loc) · 6.95 KB
/
imagebuilder_23.05.4.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: imagebuilder编译23.05.4
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 \
vim wget xmlto xxd zlib1g-dev python3-setuptools
- name: 下载imagebuilder源码
run: |
wget https://downloads.immortalwrt.org/releases/23.05.4/targets/x86/64/immortalwrt-imagebuilder-23.05.4-x86-64.Linux-x86_64.tar.xz
tar -J -x -f immortalwrt-imagebuilder-23.05.4-x86-64.Linux-x86_64.tar.xz
- name: 修改配置和编译文件
run: |
cd immortalwrt-imagebuilder-23.05.4-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=768/' .config
- name: 添加非官方包
run: |
cd immortalwrt-imagebuilder-23.05.4-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-23.05.4-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-23.05.4-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-23.05.4-x86-64-${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}
- name: 创建 release 标签
id: tag
run: |
echo "release_tag=imagebuilder23.05.4-${{ 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/delete-older-releases@v0.2.1
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编译immortalwrt23.05.2成功!","content":" 从${{ env.TIME1 }}开始到${{ env.TIME2 }}编译完成!","token":"${{ secrets.PUSHPLUS_TOKEN }}","webhook":"02","channel":"cp"}'