Skip to content

Commit

Permalink
新增mihomo.run
Browse files Browse the repository at this point in the history
  • Loading branch information
wukongdaily authored Jan 4, 2025
1 parent 9506410 commit f1937ab
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 3 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/mihomo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#=================================================
# https://github.com/wukongdaily/RunFilesBuilder
# Description: Build RunFiles using GitHub Actions
# Lisence: MIT
# Author: wukongdaily
# Blog: wkdaily.cpolar.top
#=================================================

name: Make MiHomo run files

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Fetch latest release tag from mihomo
id: fetch_latest_tag
run: |
latest_tag=$(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | jq -r '.tag_name')
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
# https://github.com/morytyann/OpenWrt-mihomo/releases/download/v1.17.1/mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz
- name: Clone makeself repository
run: git clone https://github.com/megastep/makeself.git

- name: Download latest mihomo files
run: |
curl -LO $(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | grep -oP '"browser_download_url":\s*".*mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz"' | cut -d '"' -f 4)
curl -LO $(curl -s https://api.github.com/repos/morytyann/OpenWrt-mihomo/releases/latest | grep -oP '"browser_download_url":\s*".*mihomo_x86_64-openwrt-24.10.tar.gz"' | cut -d '"' -f 4)
tar --one-top-level=mihomo_aarch64_cortex-a53-openwrt-24.10 -xvzf mihomo_aarch64_cortex-a53-openwrt-24.10.tar.gz
tar --one-top-level=mihomo_x86_64-openwrt-24.10 -xvzf mihomo_x86_64-openwrt-24.10.tar.gz
- name: Organize files for aarch64_cortex-a53&x86_64
run: |
mkdir mihomo_x86_64 mihomo_aarch64_cortex-a53
cp mihomo_x86_64-openwrt-24.10/*.ipk mihomo_x86_64/
cp mihomo_aarch64_cortex-a53-openwrt-24.10/*.ipk mihomo_aarch64_cortex-a53/
- name: Create install.sh scripts
run: |
cat <<EOF > mihomo_x86_64/install.sh
#!/bin/sh
opkg update
if [ $? -ne 0 ]; then
echo "update failed。"
exit 1
fi
opkg install *.ipk
EOF
chmod +x mihomo_x86_64/install.sh
cp mihomo_x86_64/install.sh mihomo_aarch64_cortex-a53/install.sh
- name: Move mihomo directories to makeself
run: |
mv mihomo_x86_64 makeself/
mv mihomo_aarch64_cortex-a53 makeself/
- name: Create self-extracting packages
run: |
cd makeself
./makeself.sh mihomo_x86_64/ mihomo_${{ env.LATEST_TAG }}_x86_64.run "by github action" ./install.sh
./makeself.sh mihomo_aarch64_cortex-a53/ mihomo_${{ env.LATEST_TAG }}_aarch64_cortex-a53.run "by github action" ./install.sh
- name: Check file sizes
run: |
ls -lh makeself/mihomo_*.run
- name: Fetch latest release details
id: fetch_release_details
run: |
extra_content="![Github](https://img.shields.io/badge/mihomo.run-123456?logo=github&logoColor=fff&labelColor=yellow&style=for-the-badge) [![Github](https://img.shields.io/badge/国内加速站下载-FC7C0D?logo=github&logoColor=fff&labelColor=000&style=for-the-badge)](https://wkdaily.cpolar.top/archives/1) ![GitHub Downloads (all assets, specific tag)](https://img.shields.io/github/downloads/wukongdaily/RunFilesBuilder/${{ env.LATEST_TAG }}/total?style=for-the-badge&labelColor=black&color=%2325c2a0)"
sed -i "1i$extra_content" "${{ github.workspace }}/info.md"
- name: Print release notes
run: |
cat ${{ github.workspace }}/info.md
- name: Generate new tag & release
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.LATEST_TAG }}
target_commitish: ${{ github.ref_name }}
prerelease: false
body_path: ${{ github.workspace }}/info.md

- name: Upload run files as release assets
uses: softprops/[email protected]
with:
tag_name: ${{ env.LATEST_TAG }}
name: "mihomo-${{ env.LATEST_TAG }}"
files: makeself/mihomo_*.run
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Github](https://img.shields.io/badge/Passwall.run-123456?logo=github&logoColor=fff&labelColor=green&style=for-the-badge) ![Github](https://img.shields.io/badge/openclash.run-123456?logo=github&logoColor=fff&labelColor=red&style=for-the-badge) ![Github](https://img.shields.io/badge/SSRP.run-123456?logo=github&logoColor=fff&labelColor=blue&style=for-the-badge) ![Github](https://img.shields.io/badge/passwall2.run-123456?logo=github&logoColor=fff&labelColor=AB5ED8&style=for-the-badge)
![Github](https://img.shields.io/badge/Passwall.run-123456?logo=github&logoColor=fff&labelColor=green&style=for-the-badge) ![Github](https://img.shields.io/badge/openclash.run-123456?logo=github&logoColor=fff&labelColor=red&style=for-the-badge) ![Github](https://img.shields.io/badge/SSRP.run-123456?logo=github&logoColor=fff&labelColor=blue&style=for-the-badge) ![Github](https://img.shields.io/badge/passwall2.run-123456?logo=github&logoColor=fff&labelColor=AB5ED8&style=for-the-badge) ![Github](https://img.shields.io/badge/mihomo.run-123456?logo=github&logoColor=fff&labelColor=yellow&style=for-the-badge)
# RunFilesBuilder
<img src="https://img.shields.io/github/downloads/wukongdaily/RunFilesBuilder/total.svg?style=for-the-badge&color=32C955"/> [![GitHub Release](https://img.shields.io/github/v/release/wukongdaily/RunFilesBuilder?style=for-the-badge&logoColor=green&color=%23E1A8CD)](https://github.com/wukongdaily/RunFilesBuilder/releases)

Expand All @@ -11,11 +11,12 @@
## 实现原理和操作指南
[![操作步骤](https://img.shields.io/badge/YouTube-123456?logo=youtube&labelColor=ff0000)](https://youtu.be/o0TN8LV01i4)

## 参考项目
## 鸣谢项目
> 【打包】https://github.com/megastep/makeself
> > 【引用】https://github.com/xiaorouji/openwrt-passwall<br>
> > 【引用】https://github.com/vernesong/OpenClash<br>
> > 【引用】https://dl.openwrt.ai
> > 【引用】https://dl.openwrt.ai<br>
> > 【引用】https://github.com/morytyann/OpenWrt-mihomo/wiki<br>
> > > 【原理解析】https://wkdaily.cpolar.top/archives/makerun

5 changes: 5 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Prerequisites

- OpenWrt >= 23.05
- Linux Kernel >= 5.10
- firewall4

0 comments on commit f1937ab

Please sign in to comment.