Skip to content

Autoupdate Python Versions #270

Autoupdate Python Versions

Autoupdate Python Versions #270

name: Autoupdate Python Versions
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
# Or if the "scripts" directory is modified
push:
paths:
- 'scripts/**'
- '.github/workflows/autoupdate_python_versions.yml'
env:
MAIN_PYTHON_VERSION: '3.12'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
autoupdate-python-versions:
name: Autoupdate Python Versions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
- name: Set up Python ${{ env.MAIN_PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Run the autoupdate script
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
python scripts/update_python_versions.py
- name: Commit changes (if any)
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'chore: update Python versions'
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
title: 'chore: update Python versions'
body: 'This PR updates the Python versions in the CI configuration files.'
branch: feat/update-python-version
base: main
delete-branch: true