Skip to content

Commit

Permalink
cd.yml: Use Gadi-specific outputs/metadata for build-db upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeGat committed Jan 23, 2025
1 parent 0b92cf3 commit a0f0bbe
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: echo "created-at=$(gh release view --json createdAt --jq '.createdAt' --repo ${{ github.repository }})" >> $GITHUB_OUTPUT

# FIXME: This won't work until ACCESS-NRI/build-cd#201 is resolved
# TODO: This will only upload data related to the Gadi deployment
build-db:
name: Build DB Metadata Upload
needs:
Expand All @@ -223,6 +223,20 @@ jobs:
with:
pattern: ${{ needs.deploy-release.outputs.general-metadata-artifact-glob }}
path: ${{ env.METADATA_PATH }}
merge-multiple: true

- name: Download Outputs Artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.deploy-release.outputs.general-outputs-artifact-glob }}
path: ${{ env.OUTPUTS_PATH }}
merge-multiple: true

- name: 'Get Gadi spack-* Repo Versions'
id: spack-versions
run: |
echo "packages-version=$(jq --raw-output --compact-output '.spack_packages_version' ${{ env.OUTPUTS_PATH }}/deploy-outputs.Gadi)" >> $GITHUB_OUTPUT
echo "config-version=$(jq --raw-output --compact-output '.spack_config_version' ${{ env.OUTPUTS_PATH }}/deploy-outputs.Gadi)" >> $GITHUB_OUTPUT
- name: Checkout Upload Script
uses: actions/checkout@v4
Expand All @@ -241,9 +255,12 @@ jobs:
- name: Upload Build Metadata
env:
BUILD_DB_CONNECTION_STR: ${{ secrets.BUILD_DB_CONNECTION_STR }}
OUTPUT_PATH: ./metadata_output
run: |
./scripts/generate-build-metadata.bash ${{ needs.release.outputs.url }} ${{ needs.release.outputs.created-at }} ${{ needs.deploy-to-environment.outputs.packages-version }} ${{ needs.deploy-to-environment.outputs.config-version }} ${{ env.METADATA_PATH }} ${{ env.OUTPUT_PATH }} ${{ inputs.root-sbd }} ${{ vars.BUILD_DB_PACKAGES }}
./scripts/generate-build-metadata.bash \
${{ needs.release.outputs.url }} ${{ needs.release.outputs.created-at }} \
${{ steps.spack-versions.outputs.packages-version }} ${{ steps.spack-versions.outputs.config-version }} \
${{ env.METADATA_PATH }} ${{ env.OUTPUTS_PATH }} \
${{ inputs.root-sbd }} ${{ vars.BUILD_DB_PACKAGES }}
echo "Attempting upload of build_metadata.json"
python ./tools/release_provenance/save_release.py "${{ env.OUTPUT_PATH }}/build_metadata.json"
python ./tools/release_provenance/save_release.py "${{ env.OUTPUTS_PATH }}/build_metadata.json"

0 comments on commit a0f0bbe

Please sign in to comment.