@@ -150,6 +150,24 @@ jobs:
150150 permissions :
151151 contents : write
152152 packages : write
153+ strategy :
154+ matrix :
155+ include :
156+ - goos : linux
157+ goarch : amd64
158+ binary : postgres-cli-linux-amd64
159+ - goos : linux
160+ goarch : arm64
161+ binary : postgres-cli-linux-arm64
162+ - goos : darwin
163+ goarch : amd64
164+ binary : postgres-cli-darwin-amd64
165+ - goos : darwin
166+ goarch : arm64
167+ binary : postgres-cli-darwin-arm64
168+ - goos : windows
169+ goarch : amd64
170+ binary : postgres-cli-windows-amd64.exe
153171 steps :
154172 - name : Checkout repository
155173 uses : actions/checkout@v4
@@ -159,25 +177,23 @@ jobs:
159177 with :
160178 go-version : ' 1.25'
161179
162- - name : Build postgres-cli
180+ - name : Build postgres-cli (${{ matrix.goos }}-${{ matrix.goarch }})
163181 env :
164182 VERSION : ${{ needs.determine-version.outputs.version }}
183+ GOOS : ${{ matrix.goos }}
184+ GOARCH : ${{ matrix.goarch }}
165185 run : |
166186 # Remove 'v' prefix if present
167187 VERSION_NO_V="${VERSION#v}"
168188
169- # Build for multiple architectures
170- GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o postgres-cli-linux-amd64 ./cmd
171- GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o postgres-cli-linux-arm64 ./cmd
172- GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o postgres-cli-darwin-amd64 ./cmd
173- GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o postgres-cli-darwin-arm64 ./cmd
174- GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o postgres-cli-windows-amd64.exe ./cmd
189+ # Build for specific architecture
190+ go build -ldflags "-s -w -X main.version=${VERSION_NO_V}" -o ${{ matrix.binary }} ./cmd
175191
176- - name : Upload binaries as artifacts
192+ - name : Upload binary (${{ matrix.binary }})
177193 uses : actions/upload-artifact@v4
178194 with :
179- name : postgres-cli-binaries
180- path : postgres-cli-*
195+ name : ${{ matrix.binary }}
196+ path : ${{ matrix.binary }}
181197 retention-days : 7
182198
183199 build-per-arch :
@@ -334,11 +350,12 @@ jobs:
334350 - name : Checkout repository
335351 uses : actions/checkout@v4
336352
337- - name : Download postgres-cli binaries
353+ - name : Download all postgres-cli binaries
338354 uses : actions/download-artifact@v4
339355 with :
340- name : postgres-cli-binaries
356+ pattern : postgres-cli-*
341357 path : ./binaries
358+ merge-multiple : true
342359
343360 - name : Set version variables
344361 id : versions
@@ -477,7 +494,7 @@ jobs:
477494 echo "Created tags: $PG16_TAG, $PG17_TAG"
478495
479496 publish-helm-chart :
480- needs : [merge-manifests]
497+ needs : [determine-version, merge-manifests]
481498 runs-on : ubuntu-latest
482499 permissions :
483500 contents : write
@@ -492,15 +509,16 @@ jobs:
492509 with :
493510 version : ' latest'
494511
495- - name : Extract version from git tag
512+ - name : Set version from determine-version job
496513 id : version
497514 run : |
498- # Extract git tag (remove 'v' prefix if present)
499- TAG="${{ github.ref_name }}"
500- if [[ "$TAG" == v* ]]; then
501- TAG="${TAG#v}"
515+ # Use version from determine-version job
516+ VERSION="${{ needs.determine-version.outputs.version }}"
517+ # Remove 'v' prefix if present
518+ if [[ "$VERSION" == v* ]]; then
519+ VERSION="${VERSION#v}"
502520 fi
503- echo "chart_version=$TAG " >> $GITHUB_OUTPUT
521+ echo "chart_version=$VERSION " >> $GITHUB_OUTPUT
504522
505523 - name : Update Chart.yaml with release version
506524 run : |
0 commit comments