Skip to content

Commit ee8d340

Browse files
bitnerclaude
andcommitted
CI: make cargo-pgrx install idempotent (cache may already hold the binary)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6b75dba commit ee8d340

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ jobs:
6666
- name: Install cargo-pgrx
6767
run: |
6868
rustup show
69-
cargo install cargo-pgrx --version "=${{ env.PGRX_VERSION }}" --locked
69+
# The cache may already hold the cargo-pgrx binary; `cargo install` errors on an
70+
# existing binary, so only (re)install when it is missing or the wrong version.
71+
if cargo-pgrx --version 2>/dev/null | grep -qF "${PGRX_VERSION}"; then
72+
echo "cargo-pgrx ${PGRX_VERSION} already present (restored from cache)"
73+
else
74+
cargo install cargo-pgrx --version "=${PGRX_VERSION}" --locked --force
75+
fi
7076
7177
- name: Build the extension for PostgreSQL ${{ matrix.pg }}
7278
run: |

0 commit comments

Comments
 (0)