forked from jared-wong/setup-v2ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
55 lines (52 loc) · 1.74 KB
/
Copy pathaction.yml
File metadata and controls
55 lines (52 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Setup Mihomo, input clash .yaml base64
description: Install mihomo (Clash Meta) and run it in the background using a YAML config.
inputs:
config-base64:
description: 'Base64 encoded YAML config file'
required: false
config-url:
description: 'yaml链接'
required: false
mihomo-version:
description: 'Version number of mihomo'
required: false
default: "1.18.0"
runs:
using: "composite"
steps:
- name: Download mihomo
shell: bash
run: |
mkdir -p .mihomo
cd .mihomo
wget -q https://github.com/MetaCubeX/mihomo/releases/download/v${{ inputs.mihomo-version }}/mihomo-linux-amd64-v${{ inputs.mihomo-version }}.gz
gzip -d mihomo-linux-amd64-v${{ inputs.mihomo-version }}.gz
mv mihomo-linux-amd64-v${{ inputs.mihomo-version }} mihomo
chmod +x mihomo
- name: Write YAML config file
shell: bash
run: |
cd .mihomo
if [ -n "${{ inputs.config-base64 }}" ]; then
echo "${{ inputs.config-base64 }}" > config_enc.yaml
cat config_enc.yaml | base64 -d > config.yaml
elif [ -n "${{ inputs.config-url }}" ]; then
wget -q -O config.yaml "${{ inputs.config-url }}"
else
echo "Error: Either config-base64 or config-url must be provided"
exit 1
fi
- name: Download Web UI (Yacd)bash
shell: bash
run: |
wget https://github.com/haishanh/yacd/releases/download/v0.3.8/yacd.tar.xz
tar -xJvf yacd.tar.xz
mv public yacd
mkdir -p .mihomo/ui
mv yacd/* .mihomo/ui/
- name: Start mihomo with Web UI
shell: bash
run: |
cd .mihomo
echo "external-ui: ui" >> config.yaml
./mihomo -d . -f config.yaml &