Trigger buildtools on new version tag #9
Workflow file for this run
This file contains hidden or 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
| # Triggers buildtools workflow when a new version tag is created in GSAS-II | |
| # 1) This will trigger GitHub Actions in GSAS-II-buildtools workflows that have | |
| # on: repository_dispatch: | |
| # 2) an authorized user (Brian, or perhaps organization) creates a | |
| # personal access token. | |
| # Do this by clicking on "picture (upper rt) | |
| # then "Settings" in drop-down and | |
| # then select "Developer settings" (at bottom). | |
| # Finally select "Fine-grained tokens" | |
| # Personal access token settings: | |
| # select owner: APS; | |
| # select APS/GSAS-II-buildtools; | |
| # Repo permissions: contents r/w & metadata: r/o. | |
| # 3) Save the created token in this (GSAS-II) project. | |
| # Use repo-level settings on 2nd line from top (may be in ... menu). | |
| # Select Actions in Secrets & variables and create a repository secret. | |
| # Name assigned must match ${{ secrets.XXX }} in workflow's curl | |
| # call ("Authorization:" setting) | |
| name: Trigger buildtools on new version tag | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Matches version tags like v5.6.7 | |
| workflow_dispatch: # Allows manual triggering for testing | |
| jobs: | |
| trigger-buildtools: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger buildtools workflow | |
| run: | | |
| # config var follows | |
| repo_owner="AdvancedPhotonSource" | |
| curl -L \ | |
| -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.PAT }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/$repo_owner/GSAS-II-buildtools/dispatches \ | |
| -d "{\"event_type\": \"new-version-tag\", \"client_payload\": {\"tag\": \"${{ github.ref_name }}\", \"sha\": \"${{ github.sha }}\"}}" |