Repository navigation
Update model data #754
This file contains hidden or 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: Update model data | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' # Runs every 24 hours | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-releases: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: data | |
| - name: Fetch repository details | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl -s -H "Authorization: Bearer $GH_TOKEN" \ | |
| "https://api.github.com/repos/redasm-dev/redasm" > repository.json | |
| - name: Fetch releases | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl -s -H "Authorization: Bearer $GH_TOKEN" \ | |
| "https://api.github.com/repos/redasm-dev/redasm/releases" > releases.json | |
| - name: Fetch CI status | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| curl -s -H "Authorization: Bearer $GH_TOKEN" \ | |
| "https://api.github.com/repos/redasm-dev/workspace/actions/workflows/ci.yml/runs?per_page=10" > ci.json | |
| curl -s -H "Authorization: Bearer $GH_TOKEN" \ | |
| "https://api.github.com/repos/redasm-dev/workspace/actions/workflows/nightly.yml/runs?per_page=10" > nightly.json | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install matplotlib | |
| - name: Update download stats | |
| run: python3 scripts/append_downloads.py | |
| - name: Generate charts and README | |
| run: python3 scripts/generate_charts.py --csv downloads.csv --out-dir charts | |
| - name: Push updates to data branch | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add repository.json releases.json ci.json nightly.json \ | |
| downloads.csv charts/ README.md | |
| git commit -m "chore: update model" || echo "No changes to commit" | |
| git push -f origin data |