-
Notifications
You must be signed in to change notification settings - Fork 8
113 lines (98 loc) · 3.76 KB
/
crawl.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
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
name: Discv4 Crawl and DNS Update
on:
schedule:
- cron: '0 */4 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
if: github.repository == 'etclabscore/discv4-dns-lists'
name: Discv4-DNS-Crawler
runs-on: ubuntu-20.04
env:
ETH_DNS_DISCV4_CRAWLTIME: 30m
ETH_DNS_DISCV4_PARENT_DOMAIN: blockd.info
ETH_DNS_DISCV4_KEY_PATH: ./secrets/dnskey.json
ETH_DNS_DISCV4_KEYPASS_PATH: ./secrets/dnskey_password.txt
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
ETH_DNS_CLOUDFLARE_ZONEID: ${{ secrets.ETH_DNS_CLOUDFLARE_ZONEID }}
ETH_DNS_DISCV4_KEY: ${{ secrets.ETH_DNS_DISCV4_KEY }}
ETH_DNS_DISCV4_KEYPASS: ${{ secrets.ETH_DNS_DISCV4_KEYPASS }}
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22.4
id: go
- run: go version
- run: sudo apt-get install -y jq
- name: Check out code
uses: actions/checkout@v2
with:
ref: etccore
token: ${{ secrets.PAT_REPO_MEOWSBITS }}
- uses: actions/checkout@v2
with:
ref: etccore
token: ${{ secrets.PAT_REPO_MEOWSBITS }}
- name: Checkout submodules
shell: bash
run: |
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
# git config --global url."https://github.com/".insteadOf "[email protected]:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --depth=1
cd core-geth
git fetch
git fetch --tags
# checkout_ref="$(git for-each-ref --count=1 --sort=-taggerdate --format '%(tag)' refs/tags)"
# git checkout ${checkout_ref}
checkout_ref="$(git for-each-ref --count=1 --sort=-committerdate --format '%(objectname)' refs/heads/master)"
git checkout ${checkout_ref}
make all
echo "$(pwd)/build/bin" >> $GITHUB_PATH
cd ..
git diff --quiet || { git add core-geth && git -c user.name='meows' -c user.email='[email protected]' commit --author='crawler <>' -m "ci update (core-geth:${checkout_ref}) $GITHUB_RUN_ID:$GITHUB_RUN_NUMBER"; }
- name: Setup secrets
run: |
mkdir secrets
echo "$ETH_DNS_DISCV4_KEY" > "$ETH_DNS_DISCV4_KEY_PATH"
echo "$ETH_DNS_DISCV4_KEYPASS" > "$ETH_DNS_DISCV4_KEYPASS_PATH"
- name: Check env and secrets
run: |
./.ci/deps.sh
export ETH_DNS_DISCV4_KEY_PUBLICINFO="$(cat $ETH_DNS_DISCV4_KEYPASS_PATH | ethkey inspect $ETH_DNS_DISCV4_KEY_PATH | grep -E '(Addr|Pub)')"
echo "$ETH_DNS_DISCV4_KEY_PUBLICINFO"
- name: Condense Classic (ETC) nodes list
run: |
cat \
all.classic.blockd.info/nodes.json \
all.mordor.blockd.info/nodes.json \
| jq -s add \
> all.json
- name: Crawl
run: |
./.ci/crawl.sh
- name: Filter and sign
run: |
./.ci/filter_and_sign.sh classic mordor
- name: Deploy to DNS
run: |
./.ci/deploy.sh classic mordor
- name: Push
env:
GITHUB_PAT: ${{ secrets.PAT_REPO_MEOWSBITS }}
run: |
git config --local user.name 'meows'
git config --local user.email '[email protected]'
git remote set-url origin https://meowsbits:${GITHUB_PAT}@github.com/${GITHUB_REPOSITORY}.git
git push origin etccore
- uses: actions/checkout@v2
- name: HandleIfFailure
if: failure()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/issue-on-failure.md