Skip to content

Commit

Permalink
update: 2024-06-15 21:15:46
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 15, 2024
0 parents commit fe19a2f
Show file tree
Hide file tree
Showing 15 changed files with 2,201 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/auto_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# This is a basic workflow to help you get started with Actions
# 配置参考 https://github.com/alanbobs999/TopFreeProxies

name: Auto update

# Controls when the workflow will run

on:
schedule:
# Executed at 5:00, 13:00, 21:00 o'clock every day
# 表达式生成 https://crontab.guru/
- cron: '0 5,13,21 * * *'

workflow_dispatch:

jobs:
auto_update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Timezone
run: sudo timedatectl set-timezone 'Asia/Shanghai'
- name: Requirements
run: |
pip install -r ./utils/requirements
- name: SubMerge
run: |
wget -O subconverter.tar.gz https://github.com/tindy2013/subconverter/releases/latest/download/subconverter_linux64.tar.gz
tar -zxvf subconverter.tar.gz -C ./
chmod +x ./subconverter/subconverter && nohup ./subconverter/subconverter >./subconverter.log 2>&1 &
python ./utils/sub_merge.py
- name: GitMerge
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git pull origin master
git add ./merge
git add v2ray
git add clash.yaml
git commit -m "merge: $(date '+%Y-%m-%d %H:%M:%S') 合并节点"
- name: Push
uses: ad-m/github-push-action@master
with:
branch: master
- name: GitCommit
run: |
git pull origin master
git add list.json
(git commit -m "update: $(date '+%Y-%m-%d %H:%M:%S') 更新链接") || true
- name: GitPush
uses: ad-m/github-push-action@master
with:
branch: master

to_gitee:
needs: [auto_update]
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Mirror to gitee'
uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@gitee.com:mfuu/v2ray.git
ssh_private_key: ${{ secrets.MIRROR }}

to_gitlab:
needs: [auto_update]
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v1
- name: 'Mirror to gitlab'
uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@gitlab.com:mfuu/v2ray.git
ssh_private_key: ${{ secrets.MIRROR }}

update_branch:
needs: [to_gitee, to_gitlab]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: UpdateBranch
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git pull origin master
git checkout --orphan latest_branch
git add -A
git commit -am "update: $(date '+%Y-%m-%d %H:%M:%S')"
git branch -D master
git branch -m master
git push -f origin master
19 changes: 19 additions & 0 deletions .github/workflows/delete_workflow_runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Delete old workflow runs
on:
schedule:
- cron: '0 0 1 * *'
# Run monthly, at 00:00 on the 1st day of month.

jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
keep_minimum_runs: 6
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/utils/__pycache__
/utils/Country.mmdb
subconverter
subconverter.log
subconverter.tar.gz
Loading

0 comments on commit fe19a2f

Please sign in to comment.