Skip to content

Commit

Permalink
deploy-2-start.yml: Get version from spack.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeGat committed Aug 29, 2024
1 parent bef9c4e commit 136cb49
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/deploy-2-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,16 @@ jobs:
for pkg in ${{ vars.BUILD_DB_PACKAGES }}; do
# TODO: Is there a way to get the git attribute without concretizing?
pkg_repo_url=$(spack python -c "import spack.spec; print(spack.spec.Spec('$pkg').concretized().package.git)")
version=$(spack find --json ${pkg} | jq -cr '.[0].version')
# We get the version of $pkg from spack.lock, and then strip
# potential 'git.' and '=VERSION' parts from 'git.TAG=VERSION'
version=$(jq --compact-output --raw-output \
--arg p "$pkg" \
'.concrete_specs | to_entries[].value | select(.name == $p) | .version
| match("^(?:git.)?([^=]*)")
| .captures[0].string' \
${{ env.SPACK_ENV_PATH}}/spack.lock
)
pkg_release_url="${pkg_repo_url%.*}/releases/tag/${version}"
echo "$pkg pkg_repo_url is $pkg_repo_url, pkg_release_url is $pkg_release_url, version is $version"
Expand Down

0 comments on commit 136cb49

Please sign in to comment.