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