Skip to content

Commit 19aad51

Browse files
authored
25.12 初版
初版 目前只能集成imm仓库内的软件 第三方自定义软件 延后 需等待后续开发
1 parent 99f18f7 commit 19aad51

1 file changed

Lines changed: 137 additions & 0 deletions

File tree

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: build-x86-64-immortalwrt-25.12.x
2+
# 初版 暂时只能集成仓库内的软件 包括iStore商店等第三方软件等待后续开发
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
luci_version:
7+
description: "选择luci版本"
8+
required: false
9+
default: "25.12.0-rc1"
10+
type: choice
11+
options:
12+
- 25.12.0-rc1
13+
custom_router_ip:
14+
description: "请设置路由器的管理地址(仅对多网口路由器有效) 格式:192.168.x.1 或 10.x.x.1"
15+
required: true
16+
default: "192.168.100.1"
17+
profile:
18+
description: '请输入要编译固件大小 单位(MB)'
19+
required: true
20+
default: '1024'
21+
enable_store:
22+
description: "集成 store 商店"
23+
required: false
24+
type: boolean
25+
default: true
26+
include_docker:
27+
description: |
28+
是否编译 Docker 插件
29+
required: true
30+
default: 'yes'
31+
type: choice
32+
options:
33+
- 'yes'
34+
- 'no'
35+
enable_pppoe:
36+
description: "是否配置PPPoE拨号信息?"
37+
required: true
38+
default: 'no'
39+
type: choice
40+
options:
41+
- 'yes'
42+
- 'no'
43+
pppoe_account:
44+
description: "宽带账号 (若启用PPPoE)"
45+
required: false
46+
pppoe_password:
47+
description: "宽带密码 (若启用PPPoE)"
48+
required: false
49+
50+
jobs:
51+
build:
52+
runs-on: ubuntu-22.04
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v3
57+
58+
- name: Set executable permissions
59+
run: chmod +x ${{ github.workspace }}/x86-64/build25.sh
60+
61+
- name: Save Custom Router IP into OpenWrt files
62+
run: |
63+
mkdir -p "${{ github.workspace }}/custom"
64+
echo "${{ github.event.inputs.custom_router_ip }}" > "${{ github.workspace }}/custom/custom_router_ip.txt"
65+
echo "您设置的路由器管理地址是:${{ github.event.inputs.custom_router_ip }}"
66+
# 后续步骤会将该文件映射到路由器/etc/config/custom_router_ip.txt 以便用于开机脚本99-custom.sh读取用户设置的ip
67+
68+
- name: Validate PPPoE Inputs
69+
run: |
70+
if [[ "${{ inputs.enable_pppoe }}" == "yes" ]]; then
71+
if [[ -z "${{ inputs.pppoe_account }}" || -z "${{ inputs.pppoe_password }}" ]]; then
72+
echo "Error: PPPoE account and password must be provided when PPPoE is enabled!"
73+
exit 1
74+
fi
75+
fi
76+
77+
- name: Enable Store integration
78+
run: |
79+
if [ "${{ github.event.inputs.enable_store }}" == "true" ]; then
80+
echo 'CUSTOM_PACKAGES="$CUSTOM_PACKAGES luci-app-store"' >> shell/custom-packages.sh
81+
echo "✅ 已追加 luci-app-store"
82+
else
83+
echo "❎ 未启用 luci-app-store"
84+
fi
85+
86+
- name: Build ImmortalWrt-x86-64-efi 25.12.x
87+
run: |
88+
profile="${{ github.event.inputs.profile }}"
89+
include_docker="${{ github.event.inputs.include_docker }}"
90+
luci_version="${{ github.event.inputs.luci_version }}"
91+
echo "Building for profile: $profile"
92+
docker run --rm -i \
93+
--user root \
94+
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
95+
-v "${{ github.workspace }}/files:/home/build/immortalwrt/files" \
96+
-v "${{ github.workspace }}/custom:/home/build/immortalwrt/files/etc/config" \
97+
-v "${{ github.workspace }}/x86-64/imm25.config:/home/build/immortalwrt/.config" \
98+
-v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \
99+
-v "${{ github.workspace }}/x86-64/build25.sh:/home/build/immortalwrt/build.sh" \
100+
-e PROFILE=$profile \
101+
-e INCLUDE_DOCKER=$include_docker \
102+
-e ENABLE_PPPOE=${{ inputs.enable_pppoe }} \
103+
-e PPPOE_ACCOUNT=${{ inputs.pppoe_account }} \
104+
-e PPPOE_PASSWORD=${{ inputs.pppoe_password }} \
105+
immortalwrt/imagebuilder:x86-64-openwrt-${luci_version} /bin/bash /home/build/immortalwrt/build.sh
106+
107+
108+
- name: Create info
109+
run: |
110+
cat > ${{ github.workspace }}/router-info.md <<EOF
111+
## 📡 路由器后台信息
112+
<a href="https://wkdaily.cpolar.cn/archives/1">
113+
<img src="https://img.shields.io/badge/若下载慢可套用国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge"/>
114+
</a>
115+
116+
- 🏠 **后台地址**: ${{ github.event.inputs.custom_router_ip }}
117+
- 👤 **用户名**: root
118+
- 🔑 **密码**: 无
119+
EOF
120+
121+
if [ "${{ github.event.inputs.include_docker }}" == "yes" ]; then
122+
extra_content="#### 默认带docker"
123+
echo -e "\n$extra_content" >> ${{ github.workspace }}/router-info.md
124+
else
125+
echo -e "\n#### 不带docker" >> ${{ github.workspace }}/router-info.md
126+
fi
127+
128+
- name: Upload ImmortWrt as release assets
129+
uses: softprops/action-gh-release@v2.2.1
130+
with:
131+
tag_name: Autobuild-x86-64
132+
body_path: ${{ github.workspace }}/router-info.md
133+
files: |
134+
${{ github.workspace }}/bin/targets/x86/64/*squashfs-combined-efi.img.gz
135+
token: ${{ secrets.GITHUB_TOKEN }}
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)