small-packages/luci-app-easytier/.github/workflows/build.yml
2026-06-24 15:35:43 +08:00

273 lines
13 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build-OpenWrt-EasyTier
on:
#push:
workflow_dispatch:
inputs:
tag:
description: '请填写发布Releases的版本号留空不发布'
required: false
default: ''
text:
description: '请填写发布的说明'
required: false
default: ''
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TAG: "${{ github.event.inputs.tag }}"
TZ: Asia/Shanghai
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.arch }}-${{ matrix.sdk }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- aarch64_cortex-a53
- aarch64_cortex-a72
- aarch64_generic
- arm_arm1176jzf-s_vfp
- arm_arm926ej-s
- arm_cortex-a15_neon-vfpv4
- arm_cortex-a5_vfpv4
- arm_cortex-a7
- arm_cortex-a7_neon-vfpv4
- arm_cortex-a8_vfpv3
- arm_cortex-a9
- arm_cortex-a9_neon
- arm_cortex-a9_vfpv3-d16
- arm_fa526
#- arm_mpcore
- arm_xscale
- mips_24kc
#- mips_4kec
- mips_mips32
- mipsel_24kc
- mipsel_24kc_24kf
- mipsel_74kc
- mipsel_mips32
- x86_64
sdk:
- 22.03.7
- SNAPSHOT
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache OpenWrt SDK
uses: actions/cache@v5
with:
path: |
/opt/openwrt-sdk-${{ matrix.arch }}-${{ matrix.sdk }}
dl
key: sdk-${{ matrix.arch }}-${{ matrix.sdk }}
- name: Create i18n uci-defaults file
run: |
mkdir -p luci-app-easytier/root/etc/uci-defaults
cat > luci-app-easytier/root/etc/uci-defaults/luci-i18n-easytier-zh-cn << 'EOF'
#!/bin/sh
uci -q batch << EOI
set luci.languages.zh_cn='简体中文 (Simplified Chinese)'
commit luci
EOI
rm -f /tmp/luci-indexcache /tmp/luci-modulecache/*
exit 0
EOF
chmod +x luci-app-easytier/root/etc/uci-defaults/luci-i18n-easytier-zh-cn
- name: Building packages
uses: openwrt/gh-action-sdk@main
env:
ARCH: ${{ matrix.arch }}-${{ matrix.sdk }}
FEEDNAME: packages_ci
PACKAGES: easytier easytier-noweb luci-app-easytier
#NO_DEFAULT_FEEDS: 1
NO_REFRESH_CHECK: 1
NO_SHFMT_CHECK: 1
MAKEFLAGS: -j$(nproc)
V: s
- name: Generate package guide
run: |
PKG_DIR="bin/packages/${{ matrix.arch }}/packages_ci"
EASYTIER_VERSION="$(awk -F= '/^EASYTIER_VERSION=/{print $2}' version.mk)"
mkdir -p "$PKG_DIR"
cat > "$PKG_DIR/README_PACKAGE.md" << EOF
# EasyTier OpenWrt Packages / EasyTier OpenWrt 安装包说明
Build target / 构建目标: \`${{ matrix.arch }}-${{ matrix.sdk }}\`
EasyTier version / EasyTier 版本: \`${EASYTIER_VERSION:-unknown}\`
## Package types / 包格式
- \`*.ipk\`: OpenWrt 22.03.x and other opkg-based firmware package. / 适用于 OpenWrt 22.03.x 等使用 opkg 的固件。
- \`*.apk\`: OpenWrt SNAPSHOT and newer apk-based firmware package. / 适用于 OpenWrt SNAPSHOT 等使用 apk 的新版固件。
Use packages that match your device architecture and firmware package manager. Do not mix \`ipk\` and \`apk\` on the same system.
请下载与设备 CPU 架构和固件包管理器匹配的包,不要在同一系统中混用 \`ipk\` 和 \`apk\`。
## What each package does / 每个包的作用
- \`easytier\`: EasyTier core binaries installed to \`/usr/bin\`, including \`easytier-core\`, \`easytier-cli\`, and the embedded web console binary when supported by the architecture. / EasyTier 核心程序包,安装到 \`/usr/bin\`,包含 \`easytier-core\`、\`easytier-cli\`,并在架构支持时集成自建 Web 控制台程序。
- \`easytier-noweb\`: EasyTier core binaries installed to \`/usr/bin\`, without the embedded web console. Use this on devices with limited storage or when you do not need the self-hosted web console. / 不包含自建 Web 控制台的核心程序包,同样安装到 \`/usr/bin\`。适合存储空间不足或不需要自建 Web 控制台的设备。
- \`luci-app-easytier\`: LuCI web interface, init script, UCI config, upload/download tools, and service management pages. / LuCI 管理界面包含启动脚本、UCI 配置、上传/下载工具和服务管理页面。
- \`luci-i18n-easytier-zh-cn\`: Simplified Chinese translation for the LuCI interface. / LuCI 界面的简体中文语言包。
## Recommended install order / 推荐安装顺序
1. Install one core package: \`easytier\` or \`easytier-noweb\`. / 先安装一个核心包:\`easytier\` 或 \`easytier-noweb\`。
2. Install \`luci-app-easytier\`. / 再安装 \`luci-app-easytier\`。
3. Install \`luci-i18n-easytier-zh-cn\` if you need Simplified Chinese. / 如需中文界面,再安装 \`luci-i18n-easytier-zh-cn\`。
If you need the EasyTier binaries in a custom directory, do not install \`easytier\` or \`easytier-noweb\`. Install only \`luci-app-easytier\` and the language package, then open LuCI -> VPN -> EasyTier -> Upload Program, set the program directory, save it, and upload the official EasyTier release files manually.
如果需要把 EasyTier 程序安装到自定义目录,不要安装 \`easytier\` 或 \`easytier-noweb\`。只安装 \`luci-app-easytier\` 和语言包,然后进入 LuCI -> VPN -> EasyTier -> 上传程序,设置程序目录并保存,再手动上传官方 EasyTier Release 中的程序文件。
You can also use the online download function on the Upload Program page. This requires network access to GitHub. If GitHub access is slow or unavailable, configure acceleration mirror URLs before downloading.
也可以在“上传程序”页面使用在线下载功能。该功能需要设备能正常访问 GitHub如果访问慢或无法访问请先配置加速镜像地址。
## IPK installation / IPK 安装方法
Upload the packages to \`/tmp\` on your OpenWrt device, then run:
将安装包上传到 OpenWrt 设备的 \`/tmp\` 目录,然后执行:
\`\`\`sh
opkg update
opkg install /tmp/easytier_*.ipk
opkg install /tmp/luci-app-easytier_*.ipk
opkg install /tmp/luci-i18n-easytier-zh-cn_*.ipk
\`\`\`
For the no-web core package:
如果安装不含 Web 控制台的核心包:
\`\`\`sh
opkg update
opkg install /tmp/easytier-noweb_*.ipk
opkg install /tmp/luci-app-easytier_*.ipk
opkg install /tmp/luci-i18n-easytier-zh-cn_*.ipk
\`\`\`
## APK installation / APK 安装方法
Upload the packages to \`/tmp\` on your OpenWrt device, then run:
将安装包上传到 OpenWrt 设备的 \`/tmp\` 目录,然后执行:
\`\`\`sh
apk add --allow-untrusted /tmp/easytier_*.apk
apk add --allow-untrusted /tmp/luci-app-easytier_*.apk
apk add --allow-untrusted /tmp/luci-i18n-easytier-zh-cn_*.apk
\`\`\`
For the no-web core package:
如果安装不含 Web 控制台的核心包:
\`\`\`sh
apk add --allow-untrusted /tmp/easytier-noweb_*.apk
apk add --allow-untrusted /tmp/luci-app-easytier_*.apk
apk add --allow-untrusted /tmp/luci-i18n-easytier-zh-cn_*.apk
\`\`\`
## Install LuCI only and upload binaries manually / 只安装 LuCI 并手动上传程序
IPK:
\`\`\`sh
opkg update
opkg install /tmp/luci-app-easytier_*.ipk
opkg install /tmp/luci-i18n-easytier-zh-cn_*.ipk
\`\`\`
APK:
\`\`\`sh
apk add --allow-untrusted /tmp/luci-app-easytier_*.apk
apk add --allow-untrusted /tmp/luci-i18n-easytier-zh-cn_*.apk
\`\`\`
Then download the matching EasyTier Linux release from:
然后从以下地址下载匹配架构的 EasyTier Linux 官方 Release 包:
https://github.com/EasyTier/EasyTier/releases
In LuCI, go to VPN -> EasyTier -> Upload Program, set the program directory, save it, and upload \`easytier-core\`, \`easytier-cli\`, and optionally \`easytier-web-embed\`.
在 LuCI 中进入 VPN -> EasyTier -> 上传程序,设置程序目录并保存,然后上传 \`easytier-core\`、\`easytier-cli\`,以及可选的 \`easytier-web-embed\`。
## After installation / 安装后
- Refresh LuCI or log in again. / 刷新 LuCI 页面或重新登录。
- Open VPN -> EasyTier. / 打开 VPN -> EasyTier。
- Configure network name, network secret, peers, and other options, then enable the service. / 配置网络名称、网络密钥、节点等参数,然后启用服务。
- Check logs on the EasyTier log page or by running \`logread | grep -i easytier\`. / 可在 EasyTier 日志页面查看日志,或执行 \`logread | grep -i easytier\`。
## Troubleshooting / 问题处理
- Wrong architecture or package format: download the zip that matches your device architecture and firmware version. / 架构或包格式错误:请下载与设备架构和固件版本匹配的压缩包。
- Missing TUN support: install or enable \`kmod-tun\`. / 缺少 TUN 支持:安装或启用 \`kmod-tun\`。
- LuCI menu not visible: refresh the browser, clear LuCI cache, or run \`rm -f /tmp/luci-indexcache /tmp/luci-modulecache/*\` and re-login. / LuCI 菜单不显示:刷新浏览器、清理 LuCI 缓存,或执行 \`rm -f /tmp/luci-indexcache /tmp/luci-modulecache/*\` 后重新登录。
- Online download fails: check DNS, gateway, and GitHub connectivity; configure acceleration mirror URLs or upload files manually. / 在线下载失败:检查 DNS、网关和 GitHub 连通性;配置加速镜像地址或手动上传程序。
- Not enough storage: install \`easytier-noweb\`, or install only LuCI and upload binaries to a larger custom directory. / 存储空间不足:安装 \`easytier-noweb\`,或只安装 LuCI 并把程序上传到容量更大的自定义目录。
- Service does not start: verify the program path, executable permission, and configuration; then restart with \`/etc/init.d/easytier restart\`. / 服务无法启动:检查程序路径、可执行权限和配置,然后执行 \`/etc/init.d/easytier restart\`。
EOF
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.arch }}-${{ matrix.sdk }}
path: bin/packages/${{ matrix.arch }}/packages_ci/*
release:
name: Publish Release
runs-on: ubuntu-latest
needs: build
if: ${{ github.event.inputs.tag != '' }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release info
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p release
shopt -s nullglob
for dir in artifacts/*; do
name=$(basename "$dir")
files=("$dir"/*.ipk "$dir"/*.apk "$dir"/*.md)
if [ ${#files[@]} -gt 0 ]; then
zip -j "release/EasyTier-${{ env.TAG }}-${name}.zip" "${files[@]}"
fi
done
echo "build_time=$(TZ=UTC-8 date '+%Y年%m月%d日%H:%M:%S' | jq -sRr @uri)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
> ### ![](https://img.shields.io/badge/%E7%BC%96%E8%AF%91%E6%97%B6%E9%97%B4-${{ env.build_time }}-easytier?logo=github&labelColor=%E9%A1%BB)![](https://img.shields.io/github/downloads/${{ github.repository }}/${{ env.TAG }}/total?label=%E4%B8%8B%E8%BD%BD%E6%AC%A1%E6%95%B0&logo=github)
- 其中 **`22.03.7`** 里面是ipk安装包 **`SNAPSHOT`** 里面是apk安装包
- **`*.apk` 是OpenWrt新版的APK包** 对于apk包跳过证书命令
`apk add --allow-untrusted luci-app-easytier.apk`
- 每个压缩包内包含 **`README_PACKAGE.md`** 中英双语说明包含各包作用、安装顺序、IPK/APK安装方法和常见问题处理
${{ github.event.inputs.text }}
tag_name: ${{ env.TAG }}
files: release/*.zip