|
| 1 | +name: Inform the Python package index about a new DaCe release. |
| 2 | + |
| 3 | +on: |
| 4 | + # According to the [documentation](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#push) |
| 5 | + # this event will trigger even when the workflow file is not located on the default branch. |
| 6 | + push: |
| 7 | + # Only run once a new tag has been created. |
| 8 | + # For testing purposes we do not use the normal tag names. |
| 9 | + #- __phimuell_deployment_test_* |
| 10 | + tags: |
| 11 | + - __phimuell_deployment_test_* |
| 12 | + |
| 13 | + # Define this to ensure that it runs and is visible in the settings. |
| 14 | + # See https://stackoverflow.com/a/71057825 |
| 15 | + #pull_request: |
| 16 | + |
| 17 | + # According to the [documentation](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow#configuring-a-workflow-to-run-manually) |
| 18 | + # it is only possible to trigger a workflow manually, if it is located in the default branch. |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +jobs: |
| 22 | + update-dace: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Inform Index |
| 26 | + shell: bash |
| 27 | + run: | |
| 28 | + # Using the test thing. |
| 29 | + INDEX_ORGANIZATION="philip-paul-mueller" |
| 30 | + INDEX_REPO="test_package_index" |
| 31 | +
|
| 32 | + # We are using `github.sha` here to be sure that we transmit an identifier to the index |
| 33 | + # that can be checked out. Before we used `github.ref_name` but got strange results |
| 34 | + # with it. |
| 35 | + DEPENDENCY_REF="${{ github.sha }}" |
| 36 | + SOURCE_REPO="dace" |
| 37 | + SOURCE_OWNER="gridtools" |
| 38 | +
|
| 39 | + curl -L -v \ |
| 40 | + -X POST \ |
| 41 | + -H "Accept: application/vnd.github+json" \ |
| 42 | + -H "Authorization: Bearer ${{ secrets.PKG_UPDATE_TOKEN }}" \ |
| 43 | + -H "X-GitHub-Api-Version: 2022-11-28" \ |
| 44 | + "https://api.github.com/repos/${INDEX_ORGANIZATION}/${INDEX_REPO}/dispatches" \ |
| 45 | + -d '{"event_type":"update_package_index","client_payload":{"source_repo":"'"${SOURCE_REPO}"'","source_org":"'"${SOURCE_OWNER}"'","dependency_ref":"'"${DEPENDENCY_REF}"'"}}' |
0 commit comments