Skip to content

fetch list from ethereum-lists/chains #977

fetch list from ethereum-lists/chains

fetch list from ethereum-lists/chains #977

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