Skip to content

Commit b26482e

Browse files
committed
update: 2026-08-24 21:19:22
0 parents  commit b26482e

12 files changed

Lines changed: 1713 additions & 0 deletions

File tree

.github/workflows/auto_update.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# This is a basic workflow to help you get started with Actions
2+
# 配置参考 https://github.com/alanbobs999/TopFreeProxies
3+
4+
name: Auto update
5+
6+
# Controls when the workflow will run
7+
8+
on:
9+
schedule:
10+
# Executed at 5:00, 13:00, 21:00 o'clock every day
11+
# 表达式生成 https://crontab.guru/
12+
- cron: '0 5,13,21 * * *'
13+
14+
workflow_dispatch:
15+
16+
jobs:
17+
auto_update:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.10'
26+
- name: Cache
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
- name: Timezone
34+
run: sudo timedatectl set-timezone 'Asia/Shanghai'
35+
- name: Requirements
36+
run: |
37+
pip install -r ./utils/requirements
38+
- name: SubMerge
39+
run: |
40+
wget -O subconverter.tar.gz https://github.com/tindy2013/subconverter/releases/latest/download/subconverter_linux64.tar.gz
41+
tar -zxvf subconverter.tar.gz -C ./
42+
chmod +x ./subconverter/subconverter && nohup ./subconverter/subconverter >./subconverter.log 2>&1 &
43+
python ./utils/sub_merge.py
44+
- name: GitMerge
45+
run: |
46+
git config --local user.email "actions@github.com"
47+
git config --local user.name "GitHub Actions"
48+
git pull origin master
49+
git add v2ray
50+
git add clash.yaml
51+
git commit -m "merge: $(date '+%Y-%m-%d %H:%M:%S') 合并节点"
52+
- name: Push
53+
uses: ad-m/github-push-action@master
54+
with:
55+
branch: master
56+
- name: GitCommit
57+
run: |
58+
git pull origin master
59+
git add list.json
60+
(git commit -m "update: $(date '+%Y-%m-%d %H:%M:%S') 更新链接") || true
61+
- name: GitPush
62+
uses: ad-m/github-push-action@master
63+
with:
64+
branch: master
65+
66+
update_branch:
67+
needs: [auto_update]
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v2
72+
- name: UpdateBranch
73+
run: |
74+
git config --local user.email "actions@github.com"
75+
git config --local user.name "GitHub Actions"
76+
git pull origin master
77+
git checkout --orphan latest_branch
78+
git add -A
79+
git commit -am "update: $(date '+%Y-%m-%d %H:%M:%S')"
80+
git branch -D master
81+
git branch -m master
82+
git push -f origin master
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Delete old workflow runs
2+
on:
3+
schedule:
4+
- cron: '0 0 1 * *'
5+
# Run monthly, at 00:00 on the 1st day of month.
6+
7+
jobs:
8+
del_runs:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
12+
steps:
13+
- name: Delete workflow runs
14+
uses: Mattraks/delete-workflow-runs@v2
15+
with:
16+
token: ${{ github.token }}
17+
repository: ${{ github.repository }}
18+
retain_days: 30
19+
keep_minimum_runs: 6

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/utils/__pycache__
2+
/utils/Country.mmdb
3+
subconverter
4+
subconverter.log
5+
subconverter.tar.gz

0 commit comments

Comments
 (0)