Skip to content

Commit 646feea

Browse files
committed
chore: release fixes
1 parent 3ec7732 commit 646feea

4 files changed

Lines changed: 52 additions & 130 deletions

File tree

.github/workflows/go-lint.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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: |

.github/workflows/test.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
target_version: ["15", "16", "17"]
19+
target_version: ["16", "17"]
2020
steps:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
@@ -27,7 +27,7 @@ jobs:
2727
2828
- name: Build image for target version ${{ matrix.target_version }}
2929
run: |
30-
make build-${{ matrix.target_version }}
30+
task build:build-${{ matrix.target_version }}
3131
3232
- name: Test upgrade to ${{ matrix.target_version }}
3333
env:
@@ -38,17 +38,14 @@ jobs:
3838
3939
# Run tests based on target version
4040
case "${{ matrix.target_version }}" in
41-
15)
42-
# Test 14 -> 15
43-
make test-14-to-15
44-
;;
4541
16)
4642
# Test 14 -> 16 and 15 -> 16
47-
make test-14-to-16
48-
make test-15-to-16
43+
task test:upgrade-14-to-16
44+
task test:upgrade-15-to-16
4945
;;
5046
17)
5147
# Test all paths to 17
52-
make test
48+
task test:upgrade-14-to-17
49+
5350
;;
5451
esac

Taskfile.test.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ tasks:
115115
echo "🧪 Testing upgrade from PostgreSQL 16 to 17..."
116116
go test {{.GO_TEST_FLAGS}} -run "TestPostgresUpgrade/Upgrade_16_to_17"
117117
118+
upgrade-14-to-16:
119+
desc: Test upgrade from PostgreSQL 14 to 16
120+
dir: "{{.TEST_DIR}}"
121+
deps: [build]
122+
cmds:
123+
- |
124+
echo "🧪 Testing upgrade from PostgreSQL 14 to 16..."
125+
go test {{.GO_TEST_FLAGS}} -run "TestPostgresUpgrade/Upgrade_14_to_16"
126+
118127
upgrade-15-to-16:
119128
desc: Test upgrade from PostgreSQL 15 to 16
120129
dir: "{{.TEST_DIR}}"

0 commit comments

Comments
 (0)