-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.58 KB
/
sync.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
name: Sync
on:
schedule:
- cron: '0 * * * *'
permissions:
contents: write
jobs:
sync:
name: sync
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: .Net Restore
run: dotnet restore
- name: .Net Build
run: dotnet build --no-restore
- name: .Net Test
run: dotnet test -f net8.0 --no-build --no-restore
- name: Get data
run: dotnet run --project src/TorNodesParser
- name: Push data
run: |
find src/TorNodesParser -name '*.csv' -exec mv -t . {} +
if [ ! -f latest.all.csv ] || [ "$(diff latest.all.csv all.csv)" != "" ]
then
mv all.csv latest.all.csv
git add latest.all.csv
fi
if [ ! -f latest.guards.csv ] || [ "$(diff latest.guards.csv guards.csv)" != "" ]
then
mv guards.csv latest.guards.csv
git add latest.guards.csv
fi
if [ ! -f latest.exits.csv ] || [ "$(diff latest.exits.csv exits.csv)" != "" ]
then
mv exits.csv latest.exits.csv
git add latest.exits.csv
fi
if [[ `git diff --cached` ]]
then
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git commit -m "chore: auto sync" -m "[skip ci]"
git push
fi