-
Notifications
You must be signed in to change notification settings - Fork 24
115 lines (94 loc) · 2.93 KB
/
daily_run.yml
File metadata and controls
115 lines (94 loc) · 2.93 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Daily Run
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 2 * * *' # Runs at 2 AM every day
jobs:
daily-run:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: '1.24'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Initialize Go module
run: |
if [ ! -f go.mod ]; then
go mod init cf-tools
go mod tidy
fi
- name: Commit go.mod & go.sum
if: ${{ success() }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
TIMESTAMP=$(date -u +"%H:%M %d-%m-%Y")
git add go.mod go.sum
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Update dependencies - $TIMESTAMP"
git push
fi
- name: Wait for 2 seconds
run: sleep 2
- name: Add dependencies
if: ${{ success() }}
run: |
go get github.com/flynn/noise
go get golang.org/x/crypto/blake2s
go get golang.org/x/crypto/curve25519
- name: Wait for 2 seconds
run: sleep 2
- name: Build the application
if: ${{ success() }}
run: go build -o cf-tools main.go
- name: Wait for 2 seconds
run: sleep 2
- name: Run Fetch and Convert
if: ${{ success() }}
run: ./cf-tools -f
- name: Commit output from ./cf-tools -f
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_cf_v4_24.txt - $TIMESTAMP"
file_pattern: all_cf_v4_24.txt
- name: Wait for 5 seconds
run: sleep 5
- name: Run CDN Checker
if: ${{ success() }}
run: ./cf-tools -c
- name: Commit output from ./cf-tools -c
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_cdn_ipv4.txt - $TIMESTAMP"
file_pattern: all_cdn_ipv4.txt
- name: Wait for 5 seconds
run: sleep 5
- name: Run WARP Checker
if: ${{ success() }}
run: ./cf-tools -w
- name: Commit output from ./cf-tools -w
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update all_warp_ipv4.txt - $TIMESTAMP"
file_pattern: all_warp_ipv4.txt