forked from btccom/Blockchain-Known-Pools
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: action to generate files into separate branch
This enables to modify only the dataset and that the generated data-files are always up-to-date.
- Loading branch information
Showing
2 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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 "[email protected]" | ||
git config --local user.name "bitcoin-data" | ||
- name: Generate 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: 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 | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters