Update Dependencies #106
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: Update Dependencies | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/update-dependencies.yml' | |
- 'scripts/update_cmake_version.py' | |
- 'scripts/update_openssl_version.py' | |
- 'noxfile.py' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 6 * * *' # "At 06:00 every day." | |
jobs: | |
update-dep: | |
name: Update ${{ matrix.dependency_nice }} | |
if: github.repository_owner == 'scikit-build' || github.event_name != 'schedule' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- dependency: "cmake" | |
dependency_nice: "CMake" | |
- dependency: "openssl" | |
dependency_nice: "OpenSSL" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: wntrblm/nox@2024.10.09 | |
- name: "Run update: bump ${{ matrix.dependency_nice }}" | |
id: bump | |
run: | | |
nox --force-color -s bump${{ matrix.dependency != 'cmake' && format('-{0}', matrix.dependency) || '' }} | |
echo "version=$(nox -s ${{ matrix.dependency }}_version 2>/dev/null)" >> $GITHUB_OUTPUT | |
- run: echo "${{ matrix.dependency_nice }} version is ${{ steps.bump.outputs.version }}" | |
# we use this step to grab a Github App auth token, so that PRs generated by this workflow | |
# run the GHA tests. | |
- uses: actions/create-github-app-token@v1 | |
id: app-token | |
if: github.ref == 'refs/heads/main' && github.repository == 'scikit-build/cmake-python-distributions' | |
with: | |
app-id: ${{ secrets.SCIKIT_BUILD_BOT_APP_ID }} | |
private-key: ${{ secrets.SCIKIT_BUILD_BOT_APP_PRIVATE_KEY }} | |
- name: Create Pull Request | |
if: github.ref == 'refs/heads/main' && github.repository == 'scikit-build/cmake-python-distributions' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: '[Bot] Update to ${{ matrix.dependency_nice }} ${{ steps.bump.outputs.version }}' | |
title: '[Bot] Update to ${{ matrix.dependency_nice }} ${{ steps.bump.outputs.version }}' | |
body: | | |
Created by update_${{ matrix.dependency }}_version.py | |
PR generated by "Update ${{ matrix.dependency_nice }}" [workflow](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | |
branch: update-${{ matrix.dependency }}-pr | |
sign-commits: true | |
token: ${{ steps.app-token.outputs.token }} | |
delete-branch: true |