forked from fish2018/ClashForge
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 1.76 KB
/
main.yml
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
56
57
58
59
60
61
62
63
name: ClashForge
on:
schedule:
- cron: '10,40 * * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# 转到 Settings > Secrets and variables > Actions
# 点击 New repository secret,添加 Secret,名称为 PAT,输入你的token
token: ${{ secrets.PAT }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.10'
- name: Install requirements.txt
run: |
pip install -r ./requirements.txt
- name: sub list
env:
SUB: ${{ secrets.SUB }}
run: |
# 写订阅文件
echo "==========ls==========="
ls
mkdir -p ./input/
echo "==========ls==========="
ls
echo "==========ls input==========="
ls ./input/
cat << EOF > ./input/sub.txt
$SUB
EOF
echo "==========cat==========="
cat ./input/sub.txt
- name: Run ClashForge.py
run: python ClashForge.py
# - name: Commit and push file
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git add clash_config.yaml
# git commit -m "update" || echo "No changes to commit"
# git push https://${{ secrets.BOT }}:[email protected]/${GITHUB_REPOSITORY}.git
- name: deploy to gists
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.PAT }}
gist_id: ${{ secrets.ID }}
gist_file_name: clashforge.yaml
file_path: clash_config.yaml