├── diy.sh ├── diy_passwall.sh ├── LICENSE ├── README.md └── .github └── workflows ├── build-openwrt.yml └── build-openwrt-passwall.yml /diy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # Description: DIY script 4 | # Lisence: MIT 5 | # Author: P3TERX 6 | # Blog: https://p3terx.com 7 | #================================================= 8 | # Modify default IP 9 | sed -i 's/192.168.1.1/192.168.100.254/g' package/base-files/files/bin/config_generate 10 | mkdir package/my 11 | git clone https://github.com/Leo-Jo-My/luci-app-ssr-plus-Jo package/my/luci-app-ssr-plus-Jo 12 | ./scripts/feeds update -a 13 | ./scripts/feeds install -a 14 | -------------------------------------------------------------------------------- /diy_passwall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # Description: DIY script 4 | # Lisence: MIT 5 | # Author: P3TERX 6 | # Blog: https://p3terx.com 7 | #================================================= 8 | # Modify default IP 9 | sed -i 's/192.168.1.1/192.168.100.254/g' package/base-files/files/bin/config_generate 10 | mkdir package/my 11 | echo "src-git lienol https://github.com/Lienol/openwrt-package" >> feeds.conf.default 12 | ./scripts/feeds clean 13 | ./scripts/feeds update -a 14 | rm -rf feeds/lienol/package/ipt2socks 15 | rm -rf feeds/lienol/package/shadowsocksr-libev 16 | rm -rf feeds/lienol/package/pdnsd-alt 17 | rm -rf feeds/lienol/package/verysync 18 | rm -rf feeds/lienol/others/luci-app-verysync 19 | rm -rf package/lean/kcptun 20 | rm -rf package/lean/trojan 21 | rm -rf package/lean/luci-app-kodexplorer 22 | rm -rf package/lean/luci-app-pppoe-relay 23 | rm -rf package/lean/luci-app-pptp-server 24 | rm -rf package/lean/luci-app-v2ray-server 25 | ./scripts/feeds install -a 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 P3TERX 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Actions-OpenWrt 2 | 3 | [![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square&label=LICENSE)](https://github.com/P3TERX/Actions-OpenWrt/blob/master/LICENSE) 4 | [![GitHub Stars](https://img.shields.io/github/stars/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Stars&logo=github)](https://github.com/P3TERX/Actions-OpenWrt/stargazers) 5 | [![GitHub Forks](https://img.shields.io/github/forks/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Forks&logo=github)](https://github.com/P3TERX/Actions-OpenWrt/fork) 6 | 7 | Build OpenWrt using GitHub Actions 8 | 9 | [Read the details in my blog (in Chinese) | 中文教程](https://p3terx.com/archives/build-openwrt-with-github-actions.html) 10 | 11 | ## Usage 12 | 13 | - Click the [Use this template](https://github.com/P3TERX/Actions-OpenWrt/generate) button to create a new repository. 14 | - Generate `.config` files using [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) source code. ( You can change it through environment variables in the workflow file. ) 15 | - Push `.config` file to the GitHub repository, and the build starts automatically.Progress can be viewed on the Actions page. 16 | - When the build is complete, click the `Artifacts` button in the upper right corner of the Actions page to download the binaries. 17 | 18 | ## Acknowledgments 19 | 20 | - [Microsoft](https://www.microsoft.com) 21 | - [Microsoft Azure](https://azure.microsoft.com) 22 | - [GitHub](https://github.com) 23 | - [GitHub Actions](https://github.com/features/actions) 24 | - [tmate](https://github.com/tmate-io/tmate) 25 | - [mxschmitt/action-tmate](https://github.com/mxschmitt/action-tmate) 26 | - [csexton/debugger-action](https://github.com/csexton/debugger-action) 27 | - [Cisco](https://www.cisco.com/) 28 | - [OpenWrt](https://github.com/openwrt/openwrt) 29 | - [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) 30 | 31 | ## License 32 | 33 | [MIT](https://github.com/P3TERX/Actions-OpenWrt/blob/master/LICENSE) © P3TERX 34 | -------------------------------------------------------------------------------- /.github/workflows/build-openwrt.yml: -------------------------------------------------------------------------------- 1 | #================================================= 2 | # https://github.com/P3TERX/Actions-OpenWrt 3 | # Description: Build OpenWrt using GitHub Actions 4 | # Lisence: MIT 5 | # Author: P3TERX 6 | # Blog: https://p3terx.com 7 | #================================================= 8 | 9 | name: Build OpenWrt 10 | 11 | on: 12 | release: 13 | types: [published] 14 | push: 15 | branches: 16 | - master 17 | paths: 18 | - '.config' 19 | # schedule: 20 | # - cron: 0 8 * * 5 21 | watch: 22 | types: [started] 23 | 24 | env: 25 | REPO_URL: https://github.com/coolsnowwolf/lede 26 | REPO_BRANCH: master 27 | CONFIG_FILE: .config 28 | DIY_SH: diy.sh 29 | FREE_UP_DISK: false 30 | SSH_ACTIONS: false 31 | UPLOAD_BIN_DIR: true 32 | UPLOAD_FIRMWARE: true 33 | TZ: Asia/Shanghai 34 | 35 | jobs: 36 | build: 37 | runs-on: ubuntu-latest 38 | 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@master 42 | 43 | - name: Initialization environment 44 | env: 45 | DEBIAN_FRONTEND: noninteractive 46 | run: | 47 | sudo swapoff /swapfile 48 | sudo rm -rf /swapfile /etc/apt/sources.list.d/* 49 | sudo -E apt-get -qq update 50 | sudo -E apt-get -qq install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler 51 | curl -fsSL https://raw.githubusercontent.com/P3TERX/dotfiles/master/.bashrc >> ~/.bashrc 52 | 53 | - name: Free up disk space 54 | if: env.FREE_UP_DISK == 'true' 55 | env: 56 | DEBIAN_FRONTEND: noninteractive 57 | run: | 58 | sudo rm -rf /usr/share/dotnet 59 | docker rmi `docker images -q` 60 | sudo -E apt-get -q purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* 61 | sudo -E apt-get -qq autoremove --purge 62 | sudo -E apt-get -qq clean 63 | 64 | - name: Clone source code 65 | run: git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt 66 | 67 | - name: Update feeds 68 | run: cd openwrt && ./scripts/feeds update -a 69 | 70 | - name: Install feeds 71 | run: cd openwrt && ./scripts/feeds install -a 72 | 73 | - name: Load custom configuration 74 | run: | 75 | [ -e files ] && mv files openwrt/files 76 | [ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config 77 | chmod +x $DIY_SH 78 | cd openwrt 79 | ../$DIY_SH 80 | make defconfig 81 | 82 | - name: SSH connection to Actions 83 | uses: P3TERX/debugger-action@master 84 | if: env.SSH_ACTIONS == 'true' 85 | 86 | - name: Download package 87 | id: package 88 | run: | 89 | cd openwrt 90 | make download -j8 91 | find dl -size -1024c -exec ls -l {} \; 92 | find dl -size -1024c -exec rm -f {} \; 93 | 94 | - name: Compile the firmware 95 | id: compile 96 | run: | 97 | cd openwrt 98 | echo -e "$(nproc) thread compile" 99 | make -j$(nproc) || make -j1 V=s 100 | echo "::set-output name=status::success" 101 | 102 | - name: Upload bin directory 103 | uses: actions/upload-artifact@master 104 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 105 | with: 106 | name: OpenWrt_directory 107 | path: openwrt/bin 108 | 109 | - name: Organize files 110 | id: organize 111 | if: env.UPLOAD_FIRMWARE == 'true' && !cancelled() 112 | run: | 113 | cd openwrt/bin/targets/*/* 114 | rm -rf packages 115 | echo "::set-env name=FIRMWARE::$(pwd)" 116 | echo "::set-output name=status::success" 117 | 118 | - name: Upload firmware directory 119 | uses: actions/upload-artifact@master 120 | if: steps.organize.outputs.status == 'success' && !cancelled() 121 | with: 122 | name: OpenWrt_firmware 123 | path: ${{ env.FIRMWARE }} 124 | -------------------------------------------------------------------------------- /.github/workflows/build-openwrt-passwall.yml: -------------------------------------------------------------------------------- 1 | #================================================= 2 | # https://github.com/P3TERX/Actions-OpenWrt 3 | # Description: Build OpenWrt using GitHub Actions 4 | # Lisence: MIT 5 | # Author: P3TERX 6 | # Blog: https://p3terx.com 7 | #================================================= 8 | 9 | name: Build OpenWrt With passwall 10 | 11 | on: 12 | release: 13 | types: [published] 14 | push: 15 | branches: 16 | - master 17 | paths: 18 | - '.config.passwall' 19 | schedule: 20 | - cron: 0 8 * * 5 21 | watch: 22 | types: [started] 23 | 24 | env: 25 | REPO_URL: https://github.com/coolsnowwolf/lede 26 | REPO_BRANCH: master 27 | CONFIG_FILE: .config.passwall 28 | DIY_SH: diy_passwall.sh 29 | FREE_UP_DISK: false 30 | SSH_ACTIONS: false 31 | UPLOAD_BIN_DIR: true 32 | UPLOAD_FIRMWARE: true 33 | TZ: Asia/Shanghai 34 | 35 | jobs: 36 | build: 37 | runs-on: ubuntu-latest 38 | 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@master 42 | 43 | - name: Initialization environment 44 | env: 45 | DEBIAN_FRONTEND: noninteractive 46 | run: | 47 | sudo swapoff /swapfile 48 | sudo rm -rf /swapfile /etc/apt/sources.list.d/* 49 | sudo -E apt-get -qq update 50 | sudo -E apt-get -qq install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler 51 | curl -fsSL https://raw.githubusercontent.com/P3TERX/dotfiles/master/.bashrc >> ~/.bashrc 52 | 53 | - name: Free up disk space 54 | if: env.FREE_UP_DISK == 'true' 55 | env: 56 | DEBIAN_FRONTEND: noninteractive 57 | run: | 58 | sudo rm -rf /usr/share/dotnet 59 | docker rmi `docker images -q` 60 | sudo -E apt-get -q purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php* 61 | sudo -E apt-get -qq autoremove --purge 62 | sudo -E apt-get -qq clean 63 | 64 | - name: Clone source code 65 | run: git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt 66 | 67 | - name: Update feeds 68 | run: cd openwrt && ./scripts/feeds update -a 69 | 70 | - name: Install feeds 71 | run: cd openwrt && ./scripts/feeds install -a 72 | 73 | - name: Load custom configuration 74 | run: | 75 | [ -e files ] && mv files openwrt/files 76 | [ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config 77 | chmod +x $DIY_SH 78 | cd openwrt 79 | ../$DIY_SH 80 | make defconfig 81 | 82 | - name: SSH connection to Actions 83 | uses: P3TERX/debugger-action@master 84 | if: env.SSH_ACTIONS == 'true' 85 | 86 | - name: Download package 87 | id: package 88 | run: | 89 | cd openwrt 90 | make download -j8 91 | find dl -size -1024c -exec ls -l {} \; 92 | find dl -size -1024c -exec rm -f {} \; 93 | 94 | - name: Compile the firmware 95 | id: compile 96 | run: | 97 | cd openwrt 98 | echo -e "$(nproc) thread compile" 99 | make -j$(nproc) || make -j1 V=s 100 | echo "::set-output name=status::success" 101 | 102 | - name: Upload bin directory 103 | uses: actions/upload-artifact@master 104 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 105 | with: 106 | name: OpenWrt_directory 107 | path: openwrt/bin 108 | 109 | - name: Organize files 110 | id: organize 111 | if: env.UPLOAD_FIRMWARE == 'true' && !cancelled() 112 | run: | 113 | cd openwrt/bin/targets/*/* 114 | rm -rf packages 115 | echo "::set-env name=FIRMWARE::$(pwd)" 116 | echo "::set-output name=status::success" 117 | 118 | - name: Upload firmware directory 119 | uses: actions/upload-artifact@master 120 | if: steps.organize.outputs.status == 'success' && !cancelled() 121 | with: 122 | name: OpenWrt_firmware 123 | path: ${{ env.FIRMWARE }} 124 | --------------------------------------------------------------------------------