@@ -122,83 +122,87 @@ jobs:
122
122
cache-to : type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
123
123
file : ${{ matrix.postgres.dockerfile }}
124
124
merge_manifest :
125
- needs : [prepare, build, build_release_image]
126
- strategy :
127
- matrix :
128
- include : ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
129
- runs-on : ubuntu-latest
130
- outputs :
131
- matrix_results : ${{ toJSON(steps.collect_versions.outputs.results) }}
132
- steps :
133
- - uses : actions/checkout@v3
134
- - uses : DeterminateSystems/nix-installer-action@main
135
- - uses : docker/setup-buildx-action@v3
136
- - uses : docker/login-action@v2
137
- with :
138
- username : ${{ secrets.DOCKER_USERNAME }}
139
- password : ${{ secrets.DOCKER_PASSWORD }}
140
- - name : Get image tag
141
- id : get_version
142
- run : |
143
- nix run nixpkgs#nushell -- -c '
144
- let version = "${{ matrix.version }}"
145
- let release_key = if ($version | str contains "orioledb") {
146
- $"postgresorioledb-17"
147
- } else {
148
- $"postgres($version)"
149
- }
150
- let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
151
- $"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT
152
- '
153
- - name : Output version
154
- id : output_version
155
- run : |
156
- echo "result=${{ steps.get_version.outputs.pg_version }}" >> $GITHUB_OUTPUT
157
- - name : Collect versions
158
- id : collect_versions
159
- run : |
160
- versions=()
161
- versions+=("${{ steps.output_version.outputs.result }}")
162
- echo "matrix_results=[\"${versions[*]}\"]" >> $GITHUB_OUTPUT
163
- - name : Merge multi-arch manifests
164
- run : |
165
- docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \
166
- ${{ steps.get_version.outputs.pg_version }}_amd64 \
167
- ${{ steps.get_version.outputs.pg_version }}_arm64
168
- combine_versions :
169
- needs : merge_manifest
170
- runs-on : ubuntu-latest
171
- outputs :
172
- matrix : ${{ steps.set-matrix.outputs.matrix }}
173
- steps :
174
- - uses : actions/checkout@v3
175
- - uses : DeterminateSystems/nix-installer-action@main
176
- - name : Debug Merge Manifest Output
177
- run : |
178
- echo "Raw matrix_results: '${{ needs.merge_manifest.outputs.matrix_results }}'"
179
- - name : Combine versions into matrix
180
- id : set-matrix
181
- run : |
182
- nix run nixpkgs#nushell -- -c '
183
- let raw_versions = "${{ needs.merge_manifest.outputs.matrix_results }}"
184
- let versions = ($raw_versions
185
- | lines # Split into lines
186
- | each { |line| # Process each line
187
- $line
188
- | str replace "results\\[\\d+\\]=" "" # Remove the results[N]= prefix
189
- | str trim # Clean up any whitespace
190
- }
191
- | where { |it| $it != "" } # Filter out any empty lines
192
- )
193
- let matrix = {
194
- include: ($versions | each { |ver| { version: $ver } })
195
- }
196
- $"matrix=($matrix | to json -r)" | save --append $env.GITHUB_OUTPUT
197
- '
125
+ needs : [prepare, build, build_release_image]
126
+ strategy :
127
+ matrix :
128
+ include : ${{ fromJson(needs.prepare.outputs.matrix_config).include }}
129
+ runs-on : ubuntu-latest
130
+ steps :
131
+ - uses : actions/checkout@v3
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
+ - name : Get image tag
139
+ id : get_version
140
+ run : |
141
+ nix run nixpkgs#nushell -- -c '
142
+ let version = "${{ matrix.version }}"
143
+ let release_key = if ($version | str contains "orioledb") {
144
+ $"postgresorioledb-17"
145
+ } else {
146
+ $"postgres($version)"
147
+ }
148
+ let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
149
+ $"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT
150
+ '
151
+ - name : Output version
152
+ id : output_version
153
+ run : |
154
+ echo "result=${{ steps.get_version.outputs.pg_version }}" >> $GITHUB_OUTPUT
155
+ - name : Collect versions
156
+ id : collect_versions
157
+ 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
167
+ - name : Upload Results Artifact
168
+ uses : actions/upload-artifact@v3
169
+ with :
170
+ name : merge_results
171
+ path : results.txt
172
+ - name : Merge multi-arch manifests
173
+ run : |
174
+ docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \
175
+ ${{ steps.get_version.outputs.pg_version }}_amd64 \
176
+ ${{ steps.get_version.outputs.pg_version }}_arm64
177
+
178
+ combine_results :
179
+ needs : merge_manifest
180
+ runs-on : ubuntu-latest
181
+ 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
185
+ uses : actions/download-artifact@v3
186
+ with :
187
+ name : merge_results
188
+ - name : Combine Results
189
+ id : combine
190
+ run : |
191
+ 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
195
+ '
196
+ - name : Debug Combined Results
197
+ run : |
198
+ echo "Combined Results: '${{ steps.combine.outputs.matrix }}'"
199
+ outputs :
200
+ matrix : ${{ steps.combine.outputs.matrix }}
201
+
198
202
publish :
199
- needs : combine_versions
203
+ needs : combine_results
200
204
strategy :
201
- matrix : ${{ fromJson(needs.combine_versions .outputs.matrix) }}
205
+ matrix : ${{ fromJson(needs.combine_results .outputs.matrix) }}
202
206
uses : ./.github/workflows/mirror.yml
203
207
with :
204
208
version : ${{ matrix.version }}
0 commit comments