Skip to content

Monthly Update FileID #2

Monthly Update FileID

Monthly Update FileID #2

Workflow file for this run

name: Monthly Update FileID
on:
schedule:
- cron: '0 0 6 * *'
workflow_dispatch:
jobs:
update-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
pip install bs4
- name: Run update_fileid.py
run: python tools/update_fileid.py
- name: Patch version in setup.py
run: |
sed -i "s/\(version=\)'\([0-9]\+\.[0-9]\+\.[0-9]\+\)'/\1'$(python -c \"import re; version = re.search(r'version='([0-9]+\.[0-9]+\.[0-9]+)', open('setup.py').read()); major, minor, patch = version.group(1).split('.'); patch = int(patch) + 1; new_version = f'{major}.{minor}.{patch}'; print(new_version)\")'/" setup.py
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m 'Monthly update: file_id.json' || echo "No changes to commit."
- name: Push repository
run: git push