|  | 
|  | 1 | +name: Update CMake | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  pull_request: | 
|  | 5 | +    paths: | 
|  | 6 | +      - '.github/workflows/update-cmake.yml' | 
|  | 7 | +      - 'scripts/update_cmake_version.py' | 
|  | 8 | +      - 'noxfile.py' | 
|  | 9 | +      - 'CMakeUrls.cmake' | 
|  | 10 | +      - 'docs/index.rst' | 
|  | 11 | +      - 'docs/update_cmake_version.rst' | 
|  | 12 | +      - 'docs/make_a_release.rst' | 
|  | 13 | +      - 'README.rst' | 
|  | 14 | +      - 'tests/test_cmake.py' | 
|  | 15 | +      - 'pyproject.toml' | 
|  | 16 | +  workflow_dispatch: | 
|  | 17 | +  schedule: | 
|  | 18 | +    - cron: '0 6 * * *'  # "At 06:00 every day." | 
|  | 19 | + | 
|  | 20 | +jobs: | 
|  | 21 | +  update-cmake: | 
|  | 22 | +    name: Update CMake | 
|  | 23 | +    if: github.repository_owner == 'scikit-build' || github.event_name != 'schedule' | 
|  | 24 | +    runs-on: ubuntu-latest | 
|  | 25 | +    steps: | 
|  | 26 | +    - uses: actions/checkout@v4 | 
|  | 27 | + | 
|  | 28 | +    - name: "Run update: bump CMake" | 
|  | 29 | +      id: bump-cmake | 
|  | 30 | +      run: | | 
|  | 31 | +        nox --force-color -s bump | 
|  | 32 | +        echo "version=$(nox -s cmake_version 2>/dev/null)" >> $GITHUB_OUTPUT | 
|  | 33 | +    - run: echo "CMake version is ${{ steps.bump-cmake.outputs.version }}" | 
|  | 34 | + | 
|  | 35 | +    # we use this step to grab a Github App auth token, so that PRs generated by this workflow | 
|  | 36 | +    # run the GHA tests. | 
|  | 37 | +    - uses: tibdex/github-app-token@v2 | 
|  | 38 | +      id: generate-token | 
|  | 39 | +      if: github.ref == 'refs/heads/master' && github.repository == 'scikit-build/cmake-python-distributions' | 
|  | 40 | +      with: | 
|  | 41 | +        app_id: ${{ secrets.SCIKIT_BUILD_BOT_APP_ID }} | 
|  | 42 | +        private_key: ${{ secrets.SCIKIT_BUILD_BOT_APP_PRIVATE_KEY }} | 
|  | 43 | + | 
|  | 44 | +    - name: Create Pull Request | 
|  | 45 | +      if: github.ref == 'refs/heads/master' && github.repository == 'scikit-build/cmake-python-distributions' | 
|  | 46 | +      uses: peter-evans/create-pull-request@v6 | 
|  | 47 | +      with: | 
|  | 48 | +        commit-message: '[Bot] Update to CMake ${{ steps.bump-cmake.outputs.version }}' | 
|  | 49 | +        title: '[Bot] Update to CMake ${{ steps.bump-cmake.outputs.version }}' | 
|  | 50 | +        body: | | 
|  | 51 | +          Created by update_cmake_version.py | 
|  | 52 | +
 | 
|  | 53 | +          PR generated by "Update CMake" [workflow](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}). | 
|  | 54 | +        branch: update-cmake-pr | 
|  | 55 | +        committer: "scikit-build-bot[bot] <83877280+scikit-build-bot[bot]@users.noreply.github.com>" | 
|  | 56 | +        author: "scikit-build-bot[bot] <83877280+scikit-build-bot[bot]@users.noreply.github.com>" | 
|  | 57 | +        token: ${{ steps.generate-token.outputs.token }} | 
|  | 58 | +        delete-branch: true | 
0 commit comments