Track Downloads #225
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: Track Downloads | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Run at 00:00 UTC every day | |
workflow_dispatch: | |
jobs: | |
track_downloads: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pandas matplotlib requests python-dateutil | |
- name: Fetch download count | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: python .github/workflows/downloads/fetch.py | |
- name: Plot download data | |
run: python .github/workflows/downloads/plot.py | |
- name: Upload CSV artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: downloads-csv | |
path: downloads.csv | |
- name: Upload PNG artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: downloads-png | |
path: downloads.png |