forked from btccom/Blockchain-Known-Pools
-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (47 loc) · 1.65 KB
/
generate.yml
File metadata and controls
51 lines (47 loc) · 1.65 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
# This workflow generates files that can be consumed by downstream tools.
name: generate
env:
FILENAME_POOL_LIST: pool-list.json
FILENAME_POOLS_JSON: pools.json
on:
push:
branches:
- master
jobs:
generate-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Configure git
run: |
git config --local user.email "bitcoin-data@users.noreply.github.com"
git config --local user.name "bitcoin-data"
- name: Generate mainnet files
run: |
python3 contrib/generate-json-pool-list.py new-$FILENAME_POOL_LIST
python3 contrib/generate-old-pools-json.py new-$FILENAME_POOLS_JSON
- name: Generate signet files
run: |
python3 contrib/generate-json-pool-list.py new-signet-$FILENAME_POOL_LIST signet-pools/
python3 contrib/generate-old-pools-json.py new-signet-$FILENAME_POOLS_JSON signet-pools/
- name: Checkout 'generated' branch
run:
git checkout generated
- name: Overwrite old files
run: |
mv new-$FILENAME_POOL_LIST $FILENAME_POOL_LIST
mv new-$FILENAME_POOLS_JSON $FILENAME_POOLS_JSON
mv new-signet-$FILENAME_POOL_LIST signet-$FILENAME_POOL_LIST
mv new-signet-$FILENAME_POOLS_JSON signet-$FILENAME_POOLS_JSON
- name: Commit changes
run: |
git add *.json
git commit -m "Update generated files: $(date)" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: generated