Skip to content

Commit

Permalink
chore: fix pgrx-pg-sys
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed Jun 4, 2024
1 parent 896379e commit 3269d04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/update_vendor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Generate
run: |
export PGRX=$(grep -o 'pgrx = { version = "=[^"]*' Cargo.toml | cut -d = -f 4)
export BRANCH=$(grep -o 'pgrx = { git = "https://github.com/tensorchord/pgrx.git", branch = "[^"]*' Cargo.toml | cut -d '"' -f 4)
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
-e "VERSION=14" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
-e "VERSION=15" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
docker run --rm --platform linux/amd64 -v ./:/mnt/build \
-e "VERSION=16" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
-e "VERSION=14" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=14" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
-e "VERSION=15" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=15" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
docker run --rm --platform linux/arm64 -v ./:/mnt/build \
-e "VERSION=16" -e "PGRX=$PGRX" debian:buster bash /mnt/build/scripts/update_vendor.sh &
-e "VERSION=16" -e "BRANCH=$BRANCH" debian:buster bash /mnt/build/scripts/update_vendor.sh &
wait
sudo chown -R $USER ./vendor
- name: Create Pull Request
Expand Down
6 changes: 3 additions & 3 deletions scripts/update_vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -e

printf "VERSION = ${VERSION}\n"
printf "PGRX = ${PGRX}\n"
printf "BRANCH = ${BRANCH}\n"

apt-get update
apt-get install -y --no-install-recommends ca-certificates curl build-essential gnupg lsb-release wget
apt-get install -y --no-install-recommends ca-certificates curl build-essential gnupg lsb-release wget git

echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee -a /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
Expand All @@ -18,7 +18,7 @@ source ~/.cargo/env
cd $(mktemp -d)

cargo init --lib --name vectors
cargo add pgrx-pg-sys@=$PGRX --no-default-features --features pg$VERSION
cargo add pgrx-pg-sys --git https://github.com/tensorchord/pgrx.git --branch $BRANCH --no-default-features --features pg$VERSION
PGRX_PG_CONFIG_PATH=$(which pg_config) PGRX_PG_SYS_EXTRA_OUTPUT_PATH=$(pwd)/pgrx-binding.rs cargo build
rustfmt ./pgrx-binding.rs

Expand Down

0 comments on commit 3269d04

Please sign in to comment.