Process and run reports for a fee round #261
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
name: Process and run reports for a fee round | |
on: | |
workflow_dispatch: | |
inputs: | |
end_day: | |
description: "End Date of the last voting period like YYYY-MM-DD. Fees will be calcualted for the 2 week period prior 00:00GMT on this day. It should be on aThursday that during an Aura voting round." | |
required: true | |
jobs: | |
generate_fees_report: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Collect fees | |
env: | |
DRPC_KEY: ${{ secrets.DRPC_KEY }} | |
run: | | |
pwd | |
end_day=${{ github.event.inputs.end_day }} | |
start_day=$(date -d "$end_day -14 days" +%Y-%m-%d) | |
date_range_string="${start_day}_${end_day}" | |
echo $date_range_string | |
start_timestamp=$(date -d "$start_day 00:00:00" +"%s") | |
end_timestamp=$((start_timestamp + 60*60*24*14)) # 2 weeks later | |
pip3 install -r requirements.txt | |
python3 main.py --ts_now $end_timestamp --ts_in_the_past $start_timestamp --fees_file_name fees_${date_range_string}.json --output_file_name incentives_${date_range_string}.csv | |
python3 generate_merged_allocation_csv.py | |
cd fee_allocator/fees_collected | |
python ./generate_consolidated_csv.py | |
- name: Create PR | |
id: cpr | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "task: new fees report ending ${{ github.events.inputs.end_day }}" | |
title: "Biweekly Fee Report ending ${{ github.events.inputs.end_day }}" | |
branch: gha-biweekly-fees | |
branch-suffix: timestamp | |
delete-branch: true | |
labels: "Biweekly-Report" |