GitHunt
KJ

KJZH001/MoeWrt

English | 中文

Actions-OpenWrt

LICENSE
GitHub Stars
GitHub Forks

A template for building OpenWrt with GitHub Actions

Note(摘自 Lancenas/Actions-Lean-OpenWrt)

  • 自定义文件 “files 大法”是把你自定义的配置编译到固件里。这样升级或恢复出厂设置都不需要保留配置,缺省值就是自定义的配置。
  • 如你现在的network设置编译进固件:首先提取路由固件下的\etc\config\network 然后在项目根目录下创建files目录并push\files\etc\config\network ,最后编译出来的固件就是现在设置的network。
  • 通过修改diypart1.sh文件修改feeds.conf.default配置。默认添加fw876/helloworld
  • 通过修改diypart2.sh文件可以自定义默认IP,登陆密码等。按我的需要现在的默认IP为192.168.1.11,不需要更改的加#注释就可以。
  • 自定义编译的方法可以搭配使用,自己需要的服务一般不会随意变化,就可以在 make menuconfig 选好(新手参考OpenWrt MenuConfig设置和LuCI插件选项说明)后执行 ./scripts/diffconfig.sh > seed.config 复制一下这个seed.config的文本内容到项目根目录的.config文件中(建议自命名),这样就不用每次都SSH连接到 Actions生成编译配置,真正一键编译。
  • 修改.github/workflows/build-openwrt.yml.config为你的自命名###.config文件。
  • 另外如果,使用“files 大法”仓库最好设为私有,否则你的配置信息,如宽带账号等会公开在网上。
  • 如果需要可以编写多个workflows文件对应###.config,开启多流程同时编译。
  • 在 Actions 页面选择Build OpenWrt,然后点击Run Workflow按钮,即可开始编译。(如果需要 SSH 连接则把SSH connection to Actions的值改为true)

Usage

  • Click the Use this template button to create a new repository.
  • Generate .config files using Lean's OpenWrt source code. ( You can change it through environment variables in the workflow file. )
  • Push .config file to the GitHub repository.
  • Select Build OpenWrt on the Actions page.
  • Click the Run workflow button.
  • When the build is complete, click the Artifacts button in the upper right corner of the Actions page to download the binaries.

Tips

  • It may take a long time to create a .config file and build the OpenWrt firmware. Thus, before create repository to build your own firmware, you may check out if others have already built it which meet your needs by simply search Actions-Openwrt in GitHub.
  • Add some meta info of your built firmware (such as firmware architecture and installed packages) to your repository introduction, this will save others' time.

Credits

License

MIT © P3TERX

Languages

Shell100.0%

Contributors

MIT License
Created February 25, 2025
Updated January 7, 2026
KJZH001/MoeWrt | GitHunt