Upgrade dependencies #190
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: Upgrade dependencies | |
on: | |
workflow_dispatch: # Allow running on-demand | |
schedule: | |
# Runs every Monday at 8:00 UTC (4:00 Eastern) | |
- cron: '0 8 * * 1' | |
jobs: | |
upgrade: | |
name: Upgrade & Open Pull Request | |
runs-on: ubuntu-latest | |
env: | |
# This branch will receive updates each time the workflow runs | |
# It doesn't matter if it's deleted when merged, it'll be re-created | |
BRANCH_NAME: auto-dependency-upgrades | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# [Optional] Use a separate key to automatically execute checks on the resulting PR | |
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
# START PYTHON DEPENDENCIES | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: 'pyproject.toml' | |
- name: Upgrade Python dependencies | |
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW | |
run: | | |
set -x | |
pip install -U uv | |
flags=(--extra pyqt6 --extra pyside2 --extra pyside6 --extra test --extra pyinstaller_base) | |
for pyv in 3.9 3.10 3.11 3.12; do | |
uv pip compile --python-version ${pyv} --upgrade --output-file requirements/constraints_py${pyv}.txt pyproject.toml requirements/version_denylist.txt "${flags[@]}" | |
uv pip compile --python-version ${pyv} --upgrade --output-file requirements/constraints_py${pyv}_pydantic_1.txt pyproject.toml requirements/version_denylist.txt "${flags[@]}" --constraint requirements/pydantic_1.txt | |
done | |
uv pip compile --python-version 3.12 --upgrade --output-file requirements/constraints_py3.12_docs.txt pyproject.toml --extra docs --extra pyqt6 | |
# END PYTHON DEPENDENCIES | |
- name: Check updated packages | |
id: packages | |
run: | | |
python build_utils/check_updated_packages.py --main-packages | |
python build_utils/check_updated_packages.py | |
echo "main_packages=$(python build_utils/check_updated_packages.py --main-packages)" >> "$GITHUB_OUTPUT" | |
echo "all_packages<<EOF" >> "$GITHUB_OUTPUT" | |
python build_utils/check_updated_packages.py >> "$GITHUB_OUTPUT" | |
echo "EOF" >> "$GITHUB_OUTPUT" | |
- name: Create PR updating vendored modules | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update bundle dependencies. | |
branch: ${{ env.BRANCH_NAME }} | |
delete-branch: true | |
title: "test: [Automatic] Constraints upgrades: ${{ steps.packages.outputs.main_packages }}" | |
body: | | |
This PR is automatically created and updated by PartSeg GitHub | |
action cron to keep bundle dependencies modules up to date. | |
The updated packages are: | |
${{ steps.packages.outputs.all_packages }} | |
token: ${{ secrets.GHA_TOKEN }} | |
labels: | | |
skip check PR title |