generated from NiREvil/vless
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.21 KB
/
Spring.yml
File metadata and controls
73 lines (64 loc) · 2.21 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Spring
on:
push:
branches: ['main']
paths:
- '**/spring.*'
- 'edge/assets/singbox-template.json'
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
matrix:
python-version: ['3.12']
dummy: ['single']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('edge/requirements.txt') }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f edge/requirements.txt ]; then
pip install -r edge/requirements.txt
else
echo "requirements.txt not found, skipping dependency installation"
fi
- name: Run python
run: |
python edge/spring.py >> log.txt 2>&1 || (cat log.txt && exit 1)
- name: Upload log file
uses: actions/upload-artifact@v4
with:
name: spring-execution-log
path: edge/assets/logs/log.txt
- name: Commit and push if changed
run: |
git config --local user.name "Diana-Cl"
git config --local user.email "135276904+Diana-Cl@users.noreply.github.com"
git add *.json
git diff --quiet && git diff --staged --quiet || (
git commit -m "Automated config refresh completed at: $(TZ='Asia/Tehran' date '+%H:%M:%S')" -m "Wireguard private keys, addresses, reserved, and all IPs have been renewed"
git -c committer.name="NiREvil" -c committer.email="126243832+NiREvil@users.noreply.github.com" \
commit --amend --no-edit
)
git push