Skip to content

Commit 1b9fd7e

Browse files
committed
chore: use the github outputs array
1 parent 6ce3238 commit 1b9fd7e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ jobs:
148148
$"postgres($version)"
149149
}
150150
let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
151-
152151
$"pg_version=supabase/postgres:($pg_version)" | save --append $env.GITHUB_OUTPUT
153152
'
154153
- name: Output version
@@ -161,28 +160,36 @@ jobs:
161160
echo "results[${{ strategy.job-index }}]=${{ steps.output_version.outputs.result }}" >> $GITHUB_OUTPUT
162161
- name: Merge multi-arch manifests
163162
run: |
164-
docker buildx imagetools create -t supabase/postgres:${{ steps.get_version.outputs.pg_version }} \
165-
supabase/postgres:${{ steps.get_version.outputs.pg_version }}_amd64 \
166-
supabase/postgres:${{ steps.get_version.outputs.pg_version }}_arm64
167-
163+
docker buildx imagetools create -t ${{ steps.get_version.outputs.pg_version }} \
164+
${{ steps.get_version.outputs.pg_version }}_amd64 \
165+
${{ steps.get_version.outputs.pg_version }}_arm64
168166
combine_versions:
169167
needs: merge_manifest
170168
runs-on: ubuntu-latest
171169
outputs:
172170
matrix: ${{ steps.set-matrix.outputs.matrix }}
173171
steps:
172+
- uses: actions/checkout@v3
174173
- uses: DeterminateSystems/nix-installer-action@main
175174
- name: Combine versions into matrix
176175
id: set-matrix
177176
run: |
178177
nix run nixpkgs#nushell -- -c '
179-
let versions = (${{ needs.merge_manifest.outputs.matrix_results }} | from json)
178+
let raw_versions = "${{ needs.merge_manifest.outputs.matrix_results }}"
179+
let versions = ($raw_versions
180+
| lines # Split into lines
181+
| each { |line| # Process each line
182+
$line
183+
| str replace "results\\[\\d+\\]=" "" # Remove the results[N]= prefix
184+
| str trim # Clean up any whitespace
185+
}
186+
| where { |it| $it != "" } # Filter out any empty lines
187+
)
180188
let matrix = {
181189
include: ($versions | each { |ver| { version: $ver } })
182190
}
183191
$"matrix=($matrix | to json -r)" | save --append $env.GITHUB_OUTPUT
184192
'
185-
186193
publish:
187194
needs: combine_versions
188195
strategy:

0 commit comments

Comments
 (0)