Skip to content

V2Root-ConfigPilot #2867

V2Root-ConfigPilot

V2Root-ConfigPilot #2867

Workflow file for this run

name: V2Root-ConfigPilot
on:
schedule:
- cron: '0 */2 * * *' # Every 2 hours
workflow_dispatch:
jobs:
optimize-configs:
runs-on: ubuntu-latest
permissions:
contents: write # Grant write access to repository contents
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ github.token }} # Use built-in GITHUB_TOKEN
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install telethon
- name: Run FetchConfig.py
env:
TELEGRAM_SESSION_STRING: ${{ secrets.TELEGRAM_SESSION_STRING }}
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
run: |
python3 FetchConfig.py --output configs.json
- name: Debug configs.json
run: |
cat configs.json
if: failure() # Only run if previous steps fail
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
- name: Initialize Go module and install dependencies
run: |
if [ ! -f go.mod ]; then
go mod init github.com/v2root/configpilot
fi
go mod tidy
go mod download
cat go.mod # Debug: show go.mod after tidy
- name: Build and run ConfigPilot
env:
TEST_TIMEOUT: 10s
MAX_CONCURRENCY: 10
run: |
go build -o configpilot .
./configpilot
- name: Post best configs to Telegram
env:
TELEGRAM_SESSION_STRING: ${{ secrets.TELEGRAM_SESSION_STRING }}
TELEGRAM_API_ID: ${{ secrets.TELEGRAM_API_ID }}
TELEGRAM_API_HASH: ${{ secrets.TELEGRAM_API_HASH }}
run: |
python3 PostBestConfigs.py
- name: Debug post_configs.log
run: |
cat Logs/post_configs.log || echo "No log file found"
if: failure()
- name: Commit and push results
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add output/BestConfigs.txt output/BestConfigs_scored.json
git commit -m "Update BestConfigs from scheduled run" || echo "No changes to commit"
git push