|
| 1 | +# Checks for latest SuiteSparse:GraphBLAS version on GitHub and creates a PR to update the version used by this repo. |
| 2 | +name: Check for GraphBLAS updates |
| 3 | + |
| 4 | +# In addition to permissions below, must explicitly allow GitHub Actions to create pull requests. |
| 5 | +# This setting can be found in a repository's settings under Actions > General > Workflow permissions. |
| 6 | +# https://github.com/peter-evans/create-pull-request#workflow-permissions |
| 7 | +permissions: |
| 8 | + contents: write |
| 9 | + pull-requests: write |
| 10 | + |
| 11 | +on: |
| 12 | + # Note: Workflow must run at least once to appear in workflows list. |
| 13 | + # Push to the bot's branch to trigger workflow. |
| 14 | + push: |
| 15 | + branches: [ auto_update_gb_version ] |
| 16 | + |
| 17 | + # Note: Workflow must exist in main branch for workflow dispatch option to appear |
| 18 | + workflow_dispatch: |
| 19 | + |
| 20 | + # Enable cron to check for updates once a day: |
| 21 | +# schedule: |
| 22 | +# - cron: '0 0 * * *' |
| 23 | + |
| 24 | +jobs: |
| 25 | + gb_version_check: |
| 26 | + name: Check for GraphBLAS update |
| 27 | + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas' |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + |
| 34 | + - uses: actions/setup-python@v4 |
| 35 | + with: |
| 36 | + python-version: "3.11" |
| 37 | + |
| 38 | + - name: Get latest GraphBLAS version |
| 39 | + run: | |
| 40 | + python latest_suitesparse_graphblas_version.py > GB_VERSION.txt |
| 41 | + echo "GB_VERSION=$(cat GB_VERSION.txt)" >> $GITHUB_ENV |
| 42 | + shell: bash |
| 43 | + |
| 44 | + - name: Create Pull Request |
| 45 | + uses: peter-evans/create-pull-request@v5 |
| 46 | + with: |
| 47 | + # See documentation: https://github.com/peter-evans/create-pull-request |
| 48 | + # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour |
| 49 | + # TL;DR: create a PR if there is a diff and keep it up to date with changes as they arrive. |
| 50 | + # |
| 51 | + # To trigger tests with this PR set up a Personal Access Token as in the docs above. |
| 52 | +# token: ${{ secrets.PAT }} |
| 53 | + add-paths: GB_VERSION.txt |
| 54 | + commit-message: Update to GraphBLAS ${{ env.GB_VERSION }} |
| 55 | + title: Update to SuiteSparse:GraphBLAS ${{ env.GB_VERSION }} |
| 56 | + body: | |
| 57 | + Auto-generated by `update_graphblas.yml` |
| 58 | +
|
| 59 | + Close then reopen this PR to trigger tests. See [here](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs) for why automatic triggers do not work. |
| 60 | + branch: auto_update_gb_version |
| 61 | + delete-branch: true |
0 commit comments