@@ -130,11 +130,6 @@ jobs:
130
130
steps :
131
131
- uses : actions/checkout@v3
132
132
- uses : DeterminateSystems/nix-installer-action@main
133
- - uses : docker/setup-buildx-action@v3
134
- - uses : docker/login-action@v2
135
- with :
136
- username : ${{ secrets.DOCKER_USERNAME }}
137
- password : ${{ secrets.DOCKER_PASSWORD }}
138
133
- name : Get image tag
139
134
id : get_version
140
135
run : |
@@ -155,50 +150,50 @@ jobs:
155
150
- name : Collect versions
156
151
id : collect_versions
157
152
run : |
158
- versions=()
159
- versions+=("${{ steps.output_version.outputs.result }}")
160
- echo "matrix_results=[\"${versions[*]}\"]" >> $GITHUB_OUTPUT
161
- - name : Debug matrix_results Output
162
- run : |
163
- echo "Debug matrix_results: '${{ steps.collect_versions.outputs.matrix_results }}'"
164
- - name : Append Results to Artifact
165
- run : |
166
- echo "${{ steps.collect_versions.outputs.matrix_results }}" >> results.txt
153
+ echo "${{ steps.output_version.outputs.result }}" >> results.txt # Append results
167
154
- name : Upload Results Artifact
168
155
uses : actions/upload-artifact@v3
169
156
with :
170
- name : merge_results
157
+ name : merge_results-${{ matrix.version }}
171
158
path : results.txt
159
+ if-no-files-found : warn
172
160
- name : Merge multi-arch manifests
173
161
run : |
174
162
docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \
175
163
${{ steps.get_version.outputs.pg_version }}_amd64 \
176
164
${{ steps.get_version.outputs.pg_version }}_arm64
177
-
178
165
combine_results :
179
166
needs : merge_manifest
180
167
runs-on : ubuntu-latest
181
168
steps :
182
- - uses : actions/checkout@v3 # Required if other file dependencies are in the repository
183
- - uses : DeterminateSystems/nix-installer-action@main # Ensures Nushell is available
184
- - name : Download Results Artifact
169
+ - uses : actions/checkout@v3
170
+ - uses : DeterminateSystems/nix-installer-action@main
171
+ - name : Download Results Artifacts
185
172
uses : actions/download-artifact@v3
186
173
with :
187
- name : merge_results
174
+ name : merge_results-*
188
175
- name : Combine Results
189
176
id : combine
190
177
run : |
191
178
nix run nixpkgs#nushell -- -c '
192
- let results = (open results.txt | lines | where { |line| $line != "" })
193
- let matrix = { include: ($results | each { |ver| { version: $ver } }) }
194
- $"matrix=($matrix | to json -r)" | save --append $env.GITHUB_OUTPUT
179
+ # Initialize an empty array to store combined results
180
+ let combined_results = []
181
+
182
+ # Loop through all downloaded result files
183
+ ls **/results.txt | each { |result_file|
184
+ let results = (open $result_file | lines | where { $it != "" })
185
+ $combined_results = $combined_results + $results
186
+ }
187
+
188
+ # Create the matrix format for the combined results
189
+ let matrix = ($combined_results | each { { version: $it } }) | to json
190
+ $"matrix=$matrix" | save --append $env.GITHUB_OUTPUT
195
191
'
196
192
- name : Debug Combined Results
197
193
run : |
198
194
echo "Combined Results: '${{ steps.combine.outputs.matrix }}'"
199
195
outputs :
200
196
matrix : ${{ steps.combine.outputs.matrix }}
201
-
202
197
publish :
203
198
needs : combine_results
204
199
strategy :
0 commit comments