├── diy-part2.sh ├── feeds.conf.default ├── diy-part1.sh ├── LICENSE ├── .github └── workflows │ ├── update-checker.yml │ └── build-openwrt.yml └── README.md /diy-part2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part2.sh 10 | # Description: OpenWrt DIY script part 2 (After Update feeds) 11 | # 12 | 13 | # Modify default IP 14 | #sed -i 's/192.168.1.1/192.168.50.5/g' package/base-files/files/bin/config_generate 15 | -------------------------------------------------------------------------------- /feeds.conf.default: -------------------------------------------------------------------------------- 1 | src-git packages https://github.com/coolsnowwolf/packages 2 | src-git luci https://github.com/coolsnowwolf/luci 3 | src-git routing https://git.openwrt.org/feed/routing.git 4 | src-git telephony https://git.openwrt.org/feed/telephony.git 5 | src-git freifunk https://github.com/freifunk/openwrt-packages.git 6 | #src-git video https://github.com/openwrt/video.git 7 | #src-git targets https://github.com/openwrt/targets.git 8 | #src-git management https://github.com/openwrt-management/packages.git 9 | #src-git oldpackages http://git.openwrt.org/packages.git 10 | #src-link custom /usr/src/openwrt/custom-feed 11 | src-git helloworld https://github.com/fw876/helloworld 12 | -------------------------------------------------------------------------------- /diy-part1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2019-2020 P3TERX 4 | # 5 | # This is free software, licensed under the MIT License. 6 | # See /LICENSE for more information. 7 | # 8 | # https://github.com/P3TERX/Actions-OpenWrt 9 | # File name: diy-part1.sh 10 | # Description: OpenWrt DIY script part 1 (Before Update feeds) 11 | # 12 | 13 | # Uncomment a feed source 14 | #sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default 15 | 16 | # Add a feed source 17 | #sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default 18 | git clone -b lede https://github.com/pymumu/luci-app-smartdns package/luci-app-smartdns 19 | rm -rf package/lean/luci-theme-argon && git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon package/lean/luci-theme-argon 20 | git clone https://github.com/jerrykuku/luci-app-argon-config package/lean/luci-app-argon-config 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2020 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 | -------------------------------------------------------------------------------- /.github/workflows/update-checker.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2021 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # File: .github/workflows/update-checker.yml 9 | # Description: Source code update checker 10 | # 11 | 12 | name: Update Checker 13 | 14 | env: 15 | REPO_URL: https://github.com/coolsnowwolf/lede 16 | REPO_BRANCH: master 17 | 18 | on: 19 | workflow_dispatch: 20 | schedule: 21 | - cron: 0 */18 * * * 22 | 23 | jobs: 24 | check: 25 | runs-on: ubuntu-latest 26 | 27 | steps: 28 | 29 | - name: Get Commit Hash 30 | id: getHash 31 | run: | 32 | git clone --depth 1 $REPO_URL -b $REPO_BRANCH . 33 | echo "::set-output name=commitHash::$(git rev-parse HEAD)" 34 | 35 | - name: Compare Commit Hash 36 | id: cacheHash 37 | uses: actions/cache@v2 38 | with: 39 | path: .commitHash 40 | key: HEAD-${{ steps.getHash.outputs.commitHash }} 41 | 42 | - name: Save New Commit Hash 43 | if: steps.cacheHash.outputs.cache-hit != 'true' 44 | run: | 45 | echo ${{ steps.getHash.outputs.commitHash }} | tee .commitHash 46 | 47 | - name: Trigger build 48 | if: steps.cacheHash.outputs.cache-hit != 'true' 49 | uses: peter-evans/repository-dispatch@v1 50 | with: 51 | token: ${{ secrets.ACTIONS_TRIGGER_PAT }} 52 | event-type: Source Code Update 53 | 54 | - name: Delete workflow runs 55 | uses: GitRML/delete-workflow-runs@main 56 | with: 57 | retain_days: 1 58 | keep_minimum_runs: 1 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Archived. 2 | 3 | > padavan 是 ramips 最后的归宿。 4 | > ——天灵@https://github.com/immortalwrt/immortalwrt/discussions/528 5 | 6 | 建议使用 [hanwckf/padavan-4.4](https://github.com/hanwckf/padavan-4.4), [MeIsReallyBa/padavan-4.4](https://github.com/MeIsReallyBa/padavan-4.4), [padavanonly/padavan-4.4](https://github.com/padavanonly/padavan-4.4) (在MeIsReallyBa的基础上有小改), 或者 [hiboy的DRV_V5/3.4版](https://opt.cn2qq.com/padavan/K2P_DRV_V5_3.4.3.9-099.trx). Padavan在稳定性、性能、HWNAT(无线&有线)、SFE、WiFi上都有优势,甚至你还可以在4.4内核的Padavan上用SQM QoS(会自动关闭HWNAT,对于500M以下宽带问题不大)。 7 | 8 | 并不推荐在 K2P 上运行 Project V/X 之类的网络代理工具,放过MT7621和可怜的128MiB内存吧。 9 | 10 | > padavan is the final destination for ramips. 11 | > --Tianling Shen@https://github.com/immortalwrt/immortalwrt/discussions/528 12 | 13 | Please consider using [hanwckf/padavan-4.4](https://github.com/hanwckf/padavan-4.4), [MeIsReallyBa/padavan-4.4](https://github.com/MeIsReallyBa/padavan-4.4), [padavanonly/padavan-4.4](https://github.com/padavanonly/padavan-4.4) (with minor changes to MeIsReallyBa repo), or the hiboy DRV_V5 version from [here](https://opt.cn2qq.com/padavan/K2P_DRV_V5_3.4.3.9-099.trx), which are all stable, with great performance, MTK HWNAT for both ethernet and wireless, SFE support, and last but not least, better WiFi. You can even use SQM QoS on padavan 4.4 branch (HWNAT will be disabled automatically, for <500Mbps bandwidth it should be fine). 14 | 15 | Running network proxies such as Project V/X is not recommend, due to K2P's MT7621 chipset and 128MiB RAM. 16 | 17 | # Actions-OpenWrt 18 | 19 | [![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square&label=LICENSE)](https://github.com/P3TERX/Actions-OpenWrt/blob/master/LICENSE) 20 | ![GitHub Stars](https://img.shields.io/github/stars/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Stars&logo=github) 21 | ![GitHub Forks](https://img.shields.io/github/forks/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Forks&logo=github) 22 | 23 | Build OpenWrt using GitHub Actions 24 | 25 | [Read the details in my blog (in Chinese) | 中文教程](https://p3terx.com/archives/build-openwrt-with-github-actions.html) 26 | 27 | ## Usage 28 | 29 | - Click the [Use this template](https://github.com/P3TERX/Actions-OpenWrt/generate) button to create a new repository. 30 | - 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. ) 31 | - Push `.config` file to the GitHub repository. 32 | - Select `Build OpenWrt` on the Actions page. 33 | - Click the `Run workflow` button. 34 | - When the build is complete, click the `Artifacts` button in the upper right corner of the Actions page to download the binaries. 35 | 36 | ## Tips 37 | 38 | - 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](https://github.com/search?q=Actions-openwrt). 39 | - Add some meta info of your built firmware (such as firmware architecture and installed packages) to your repository introduction, this will save others' time. 40 | 41 | ## Acknowledgments 42 | 43 | - [Microsoft Azure](https://azure.microsoft.com) 44 | - [GitHub Actions](https://github.com/features/actions) 45 | - [OpenWrt](https://github.com/openwrt/openwrt) 46 | - [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) 47 | - [tmate](https://github.com/tmate-io/tmate) 48 | - [mxschmitt/action-tmate](https://github.com/mxschmitt/action-tmate) 49 | - [csexton/debugger-action](https://github.com/csexton/debugger-action) 50 | - [Cowtransfer](https://cowtransfer.com) 51 | - [WeTransfer](https://wetransfer.com/) 52 | - [Mikubill/transfer](https://github.com/Mikubill/transfer) 53 | - [softprops/action-gh-release](https://github.com/softprops/action-gh-release) 54 | - [ActionsRML/delete-workflow-runs](https://github.com/ActionsRML/delete-workflow-runs) 55 | - [dev-drprasad/delete-older-releases](https://github.com/dev-drprasad/delete-older-releases) 56 | - [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) 57 | 58 | ## License 59 | 60 | [MIT](https://github.com/P3TERX/Actions-OpenWrt/blob/main/LICENSE) © P3TERX 61 | -------------------------------------------------------------------------------- /.github/workflows/build-openwrt.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: Build OpenWrt 12 | 13 | on: 14 | repository_dispatch: 15 | workflow_dispatch: 16 | inputs: 17 | ssh: 18 | description: 'SSH connection to Actions' 19 | required: false 20 | default: 'false' 21 | schedule: 22 | - cron: 0 8 * * 5 23 | # watch: 24 | # types: started 25 | 26 | env: 27 | REPO_URL: https://github.com/coolsnowwolf/lede 28 | REPO_BRANCH: master 29 | FEEDS_CONF: feeds.conf.default 30 | CONFIG_FILE: .config 31 | DIY_P1_SH: diy-part1.sh 32 | DIY_P2_SH: diy-part2.sh 33 | UPLOAD_BIN_DIR: false 34 | UPLOAD_FIRMWARE: true 35 | UPLOAD_COWTRANSFER: true 36 | UPLOAD_WETRANSFER: true 37 | UPLOAD_RELEASE: false 38 | TZ: Asia/Shanghai 39 | 40 | jobs: 41 | build: 42 | runs-on: ubuntu-18.04 43 | 44 | steps: 45 | - name: Checkout 46 | uses: actions/checkout@main 47 | 48 | - name: Initialization environment 49 | env: 50 | DEBIAN_FRONTEND: noninteractive 51 | run: | 52 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 53 | sudo -E apt-get -qq update 54 | sudo -E apt-get -qq install $(curl -fsSL git.io/depends-ubuntu-1804) 55 | sudo -E apt-get -qq autoremove --purge 56 | sudo -E apt-get -qq clean 57 | sudo timedatectl set-timezone "$TZ" 58 | sudo mkdir -p /workdir 59 | sudo chown $USER:$GROUPS /workdir 60 | 61 | - name: Clone source code 62 | working-directory: /workdir 63 | run: | 64 | df -hT $PWD 65 | git clone $REPO_URL -b $REPO_BRANCH openwrt 66 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 67 | 68 | - name: Load custom feeds 69 | run: | 70 | [ -e $FEEDS_CONF ] && mv $FEEDS_CONF openwrt/feeds.conf.default 71 | chmod +x $DIY_P1_SH 72 | cd openwrt 73 | $GITHUB_WORKSPACE/$DIY_P1_SH 74 | 75 | - name: Update feeds 76 | run: cd openwrt && ./scripts/feeds update -a 77 | 78 | - name: Install feeds 79 | run: cd openwrt && ./scripts/feeds install -a 80 | 81 | - name: Load custom configuration 82 | run: | 83 | [ -e files ] && mv files openwrt/files 84 | [ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config 85 | chmod +x $DIY_P2_SH 86 | cd openwrt 87 | $GITHUB_WORKSPACE/$DIY_P2_SH 88 | 89 | - name: SSH connection to Actions 90 | uses: P3TERX/ssh2actions@v1.0.0 91 | if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh') 92 | env: 93 | TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} 94 | TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} 95 | 96 | - name: Download package 97 | id: package 98 | run: | 99 | cd openwrt 100 | make defconfig 101 | make download -j8 102 | find dl -size -1024c -exec ls -l {} \; 103 | find dl -size -1024c -exec rm -f {} \; 104 | 105 | - name: Compile the firmware 106 | id: compile 107 | run: | 108 | cd openwrt 109 | echo -e "$(nproc) thread compile" 110 | make -j$(nproc) || make -j1 || make -j1 V=s 111 | echo "::set-output name=status::success" 112 | grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/' > DEVICE_NAME 113 | [ -s DEVICE_NAME ] && echo "DEVICE_NAME=_$(cat DEVICE_NAME)" >> $GITHUB_ENV 114 | echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV 115 | 116 | - name: Check space usage 117 | if: (!cancelled()) 118 | run: df -hT 119 | 120 | - name: Upload bin directory 121 | uses: actions/upload-artifact@main 122 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 123 | with: 124 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 125 | path: openwrt/bin 126 | 127 | - name: Organize files 128 | id: organize 129 | if: env.UPLOAD_FIRMWARE == 'true' && !cancelled() 130 | run: | 131 | cd openwrt/bin/targets/*/* 132 | rm -rf packages 133 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 134 | echo "::set-output name=status::success" 135 | 136 | - name: Upload firmware directory 137 | uses: actions/upload-artifact@main 138 | if: steps.organize.outputs.status == 'success' && !cancelled() 139 | with: 140 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 141 | path: ${{ env.FIRMWARE }} 142 | 143 | - name: Upload firmware to cowtransfer 144 | id: cowtransfer 145 | if: steps.organize.outputs.status == 'success' && env.UPLOAD_COWTRANSFER == 'true' && !cancelled() 146 | run: | 147 | curl -fsSL git.io/file-transfer | sh 148 | ./transfer cow --block 2621440 -s -p 64 --no-progress ${FIRMWARE} 2>&1 | tee cowtransfer.log 149 | echo "::warning file=cowtransfer.com::$(cat cowtransfer.log | grep https)" 150 | echo "::set-output name=url::$(cat cowtransfer.log | grep https | cut -f3 -d" ")" 151 | 152 | - name: Upload firmware to WeTransfer 153 | id: wetransfer 154 | if: steps.organize.outputs.status == 'success' && env.UPLOAD_WETRANSFER == 'true' && !cancelled() 155 | run: | 156 | curl -fsSL git.io/file-transfer | sh 157 | ./transfer wet -s -p 16 --no-progress ${FIRMWARE} 2>&1 | tee wetransfer.log 158 | echo "::warning file=wetransfer.com::$(cat wetransfer.log | grep https)" 159 | echo "::set-output name=url::$(cat wetransfer.log | grep https | cut -f3 -d" ")" 160 | 161 | - name: Generate release tag 162 | id: tag 163 | if: env.UPLOAD_RELEASE == 'true' && !cancelled() 164 | run: | 165 | echo "::set-output name=release_tag::$(date +"%Y.%m.%d-%H%M")" 166 | touch release.txt 167 | [ $UPLOAD_COWTRANSFER = true ] && echo "🔗 [Cowtransfer](${{ steps.cowtransfer.outputs.url }})" >> release.txt 168 | [ $UPLOAD_WETRANSFER = true ] && echo "🔗 [WeTransfer](${{ steps.wetransfer.outputs.url }})" >> release.txt 169 | echo "::set-output name=status::success" 170 | 171 | - name: Upload firmware to release 172 | uses: softprops/action-gh-release@v1 173 | if: steps.tag.outputs.status == 'success' && !cancelled() 174 | env: 175 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 176 | with: 177 | tag_name: ${{ steps.tag.outputs.release_tag }} 178 | body_path: release.txt 179 | files: ${{ env.FIRMWARE }}/* 180 | 181 | - name: Delete workflow runs 182 | uses: GitRML/delete-workflow-runs@main 183 | with: 184 | retain_days: 1 185 | keep_minimum_runs: 3 186 | 187 | - name: Remove old Releases 188 | uses: dev-drprasad/delete-older-releases@v0.1.0 189 | if: env.UPLOAD_RELEASE == 'true' && !cancelled() 190 | with: 191 | keep_latest: 3 192 | delete_tags: true 193 | env: 194 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 195 | --------------------------------------------------------------------------------