-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (73 loc) · 2.74 KB
/
fetch-ethereum-lists-chains.yaml
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
name: fetch list from ethereum-lists/chains
on:
push:
branches: [ main ]
schedule:
- cron: "0 6 * * *" # “At 6:00 everyday”
workflow_dispatch:
jobs:
fetch:
name: fetch ethereum-lists/chains
runs-on: ubuntu-latest
steps:
- name: use node 17
uses: actions/setup-node@v1
with:
node-version: 17.x
- name: fetch mycurrent
uses: actions/checkout@v2
with:
path: current
- name: fetch ethereum-lists/chains
uses: actions/checkout@v2
with:
repository: ethereum-lists/chains
path: ethereum-lists-chains
- name: fetch trustwallet/assets
uses: actions/checkout@v2
with:
repository: trustwallet/assets
path: trustwallet-assets
- name: list files
run: tree -L 2 .
- name: clean up rawdata
working-directory: ./current
run: rm -rf rawdata/*
- name: copy data into rawdata/ethereum-lists
run: |
mkdir -p ./current/rawdata/ethereum-lists/chains
cp -rf ./ethereum-lists-chains/README.md ./current/rawdata/ethereum-lists
cp -rf ./ethereum-lists-chains/LICENSE ./current/rawdata/ethereum-lists
cp -rf ./ethereum-lists-chains/_data/chains/* ./current/rawdata/ethereum-lists/chains
- name: copy data into rawdata/trustwallet
run: |
mkdir -p ./current/rawdata/trustwallet/{blockchains,dapps}
cp -rf ./trustwallet-assets/README.md ./current/rawdata/trustwallet
cp -rf ./trustwallet-assets/LICENSE ./current/rawdata/trustwallet
cp -rf ./trustwallet-assets/blockchains/* ./current/rawdata/trustwallet/blockchains
cp -rf ./trustwallet-assets/dapps/* ./current/rawdata/trustwallet/dapps
- name: merge data
working-directory: ./current
run: ./scripts/merge.sh
- name: install node dependencies
working-directory: ./current
run: npm install
- name: convert data
working-directory: ./current
run: node -r esm ./scripts/convert.js
- name: list files
working-directory: ./current
run: tree -L 3 ./rawdata > README.txt
- name: check for modified files
id: git-check
working-directory: ./current
run: echo ::set-output name=modified::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)
- name: commit to main branch
if: steps.git-check.outputs.modified == 'true'
working-directory: ./current
run: |
git config --global user.name 'bot'
git config --global user.email 'bot@evm-chains.org'
git add -A
git commit -m 'feat(data): fetch list from ethereum-lists/chains'
git push