Skip to content

Process influence and packs (MainNet) #17343

Process influence and packs (MainNet)

Process influence and packs (MainNet) #17343

name: Process influence and packs (MainNet)
on:
schedule:
- cron: "0 */4 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref_name }}
jobs:
process_deposits:
name: Run city influence worker
runs-on: ubuntu-latest
env:
MANAGER_PASSPHRASE: ${{ secrets.MANAGER_PASSPHRASE }}
LEDGER_TYPE: MainNet
CITY_PACK_AMOUNT_LIMIT: ${{ secrets.CITY_PACK_AMOUNT_LIMIT}}
DISCORD_WEBHOOK_URL_MAINNET: ${{ secrets.DISCORD_WEBHOOK_URL_MAINNET}}
TELEGRAM_API_KEY_MAINNET: ${{ secrets.TELEGRAM_API_KEY_MAINNET}}
ALGOWORLD_CHANNEL_ID_MAINNET: ${{ secrets.ALGOWORLD_CHANNEL_ID_MAINNET}}
CITY_PACK_ALGO_PRICE: ${{ secrets.CITY_PACK_ALGO_PRICE}}
steps:
- uses: actions/checkout@v3
with:
ref: mainnet
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.4.2
- name: Install python dependencies
run: poetry install
- uses: pre-commit/action@v3.0.0
name: "Linters and formatters check"
with:
extra_args: --all-files --show-diff-on-failure
- name: Fetch new cities
run: |
PYTHONPATH="." poetry run python src/cities/fetch_all.py
- name: Process AWT Deposits
run: |
PYTHONPATH="." poetry run python src/cities/influence/process_deposits.py
- name: Update all cities
run: |
PYTHONPATH="." poetry run python src/cities/fetch_all.py
- name: Close purchased packs
run: |
PYTHONPATH="." poetry run python src/cities/packs/closeout.py
- name: Create new city packs
run: |
PYTHONPATH="." poetry run python src/cities/packs/create.py
- name: Commit files
id: commit_files
if: always()
run: |
git config --local user.email "millionalgos@pm.me"
git config --local user.name "github-actions[bot]"
if [ -n "$(git status --porcelain)" ]; then
git commit -m "chore(mainnet): refreshed city influence related data and processed packs 🤖" -a
echo "HAS_COMMITS=true" >> "$GITHUB_ENV"
else
echo "no changes - skipping "
echo "HAS_COMMITS=false" >> "$GITHUB_ENV"
fi
- name: Push changes
uses: ad-m/github-push-action@master
if: env.HAS_COMMITS != false
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: mainnet