Skip to content

Commit 16cfb3f

Browse files
committed
chore: utilise versions from prepare for download of artifact
1 parent 74d63aa commit 16cfb3f

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/dockerhub-release-matrix.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,29 +168,38 @@ jobs:
168168
${{ steps.get_version.outputs.pg_version }}_amd64 \
169169
${{ steps.get_version.outputs.pg_version }}_arm64
170170
combine_results:
171-
needs: merge_manifest
171+
needs: [prepare, merge_manifest]
172172
runs-on: ubuntu-latest
173173
steps:
174174
- uses: actions/checkout@v3
175175
- uses: DeterminateSystems/nix-installer-action@main
176+
- name: Get Versions from Matrix Config
177+
id: get_versions
178+
run: |
179+
# Extract the versions from prepare.outputs.matrix_config
180+
echo "Versions: ${{ fromJson(needs.prepare.outputs.matrix_config).include }}" # Print the versions for debugging
181+
echo "versions=$(echo '${{ fromJson(needs.prepare.outputs.matrix_config).include }}' | jq -r 'map(.version) | join(\",\")')" >> $GITHUB_ENV
182+
176183
- name: Download Results Artifacts
177-
uses: actions/download-artifact@v3
178-
with:
179-
name: 'merge_results-*'
184+
run: |
185+
# Split the versions into a list and download each corresponding artifact
186+
for version in $(echo ${{ env.versions }} | tr "," "\n"); do
187+
artifact_name="merge_results-${version}"
188+
echo "Downloading artifact: $artifact_name"
189+
actions/download-artifact@v3
190+
with:
191+
name: $artifact_name
180192
- name: Combine Results
181193
id: combine
182194
run: |
183195
nix run nixpkgs#nushell -- -c '
184-
# Initialize an empty array to store combined results
185196
let combined_results = []
186197
187-
# Loop through all downloaded result files
188198
ls **/results.txt | each { |result_file|
189199
let results = (open $result_file | lines | where { $it != "" })
190200
$combined_results = $combined_results + $results
191201
}
192202
193-
# Create the matrix format for the combined results
194203
let matrix = ($combined_results | each { { version: $it } }) | to json
195204
$"matrix=$matrix" | save --append $env.GITHUB_OUTPUT
196205
'

0 commit comments

Comments
 (0)