@@ -5,23 +5,18 @@ run-name: ${{ inputs.model }} Comment Command
55# permissions.contents:write
66# permissions.pull-requests:write
77
8- # FIXME: We don't support any !bump from a spack manifest that is not in the default ./spack.yaml location.
9-
108on :
119 workflow_call :
1210 inputs :
1311 model :
1412 type : string
1513 required : true
1614 description : The model that is being tested and deployed
17- root-sbd :
15+ spack-manifest-path :
1816 type : string
1917 required : false
20- # The equivalent default is set in the defaults job below.
21- # default: ${{ inputs.model }}
22- description : |
23- The name of the root Spack Bundle Definition, if it is different from the model name.
24- This is often a package named similarly in ACCESS-NRI/spack-packages.
18+ default : spack.yaml
19+ description : Path the the spack manifest in the caller
2520 # Callers usually have the trigger:
2621 # issue_comment:
2722 # types:
3025env :
3126 RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
3227jobs :
33- defaults :
34- name : Set Defaults
35- # Unfortunately, you can't set a dynamic default value based on `inputs` yet.
36- runs-on : ubuntu-latest
37- outputs :
38- root-sbd : ${{ steps.root-sbd.outputs.default }}
39- steps :
40- - name : root-sbd default
41- id : root-sbd
42- run : |
43- if [[ "${{ inputs.root-sbd }}" == "" ]]; then
44- echo "default=${{ inputs.model }}" >> $GITHUB_OUTPUT
45- else
46- echo "default=${{ inputs.root-sbd }}" >> $GITHUB_OUTPUT
47- fi
48-
4928 bump-version :
5029 name : Bump spack.yaml
5130 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '!bump')
52- needs :
53- - defaults
5431 runs-on : ubuntu-latest
5532 permissions :
5633 pull-requests : write
5734 contents : write
5835 env :
5936 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60- SPACK_YAML_MODEL_PROJECTION_YQ : .spack.modules.default.tcl.projections.${{ needs.defaults.outputs.root-sbd }}
6137 steps :
6238 - name : Get branch from issue
6339 id : issue
7450 - name : Original version
7551 id : original
7652 uses : access-nri/build-cd/.github/actions/get-spack-manifest@v8
53+ with :
54+ spack-manifest-path : ${{ inputs.spack-manifest-path }}
7755
7856 - name : Setup
7957 id : setup
@@ -132,20 +110,20 @@ jobs:
132110
133111 - name : Update, Commit and Push the Bump
134112 run : |
135- yq -i '.spack.definitions[]._version[0] = "${{ steps.bump.outputs.after }}"' spack.yaml
136- git add spack.yaml
137- git commit -m "spack.yaml : Updated deployment version from ${{ steps.original.outputs.deployment-version }} to ${{ steps.bump.outputs.after }}"
113+ yq -i '.spack.definitions[]._version[0] = "${{ steps.bump.outputs.after }}"' ${{ inputs.spack-manifest-path }}
114+ git add ${{ inputs.spack-manifest-path }}
115+ git commit -m "${{ inputs.spack-manifest-path }} : Updated deployment version from ${{ steps.original.outputs.deployment-version }} to ${{ steps.bump.outputs.after }}"
138116 git push
139117
140118 - name : Success Notifier
141119 uses : access-nri/actions/.github/actions/pr-comment@main
142120 with :
143121 comment : |
144- :white_check_mark: Version bumped from `${{ steps.original.outputs.deployment-version }}` to `${{ steps.bump.outputs.after }}` :white_check_mark:
122+ :white_check_mark: ${{ inputs.spack-manifest-path }} version bumped from `${{ steps.original.outputs.deployment-version }}` to `${{ steps.bump.outputs.after }}` :white_check_mark:
145123
146124 - name : Failure Notifier
147125 if : failure()
148126 uses : access-nri/actions/.github/actions/pr-comment@main
149127 with :
150128 comment : |
151- :x: Failed to bump version or commit changes, see ${{ env.RUN_URL }} :x:
129+ :x: Failed to bump version or commit changes to ${{ inputs.spack-manifest-path }} , see ${{ env.RUN_URL }} :x:
0 commit comments