Skip to content

Commit

Permalink
use profile in package
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy committed Nov 6, 2024
1 parent cdcecc5 commit 176f1d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/psql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ jobs:
VERSION: ${{ matrix.version }}
ARCH: ${{ matrix.arch }}
PLATFORM: "amd64"
PROFILE: "opt"
run: |
docker run --rm -v .:/workspace $CACHE_ENVS $PGRX_IMAGE build --lib --features pg${{ matrix.version }} --target ${{ matrix.arch }}-unknown-linux-gnu --profile opt
docker run --rm -v .:/workspace $CACHE_ENVS --entrypoint bash $PGRX_IMAGE ./tools/schema.sh --features pg${{ matrix.version }} --target ${{ matrix.arch }}-unknown-linux-gnu --profile opt
docker run --rm -v .:/workspace $CACHE_ENVS --entrypoint bash $PGRX_IMAGE ./tools/schema.sh --features pg${{ matrix.version }} --target ${{ matrix.arch }}-unknown-linux-gnu --profile $PROFILE
./tools/package.sh
docker build -t rabbithole:pg${{ matrix.version }} --build-arg PG_VERSION=${{ matrix.version }} -f ./docker/Dockerfile .
Expand Down
1 change: 1 addition & 0 deletions bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export SEMVER="0.0.0"
export VERSION="16"
export ARCH="x86_64"
export PLATFORM="amd64"
export PROFILE="opt"
./tools/package.sh

docker build -t rabbithole:pg16-latest --build-arg PG_VERSION=16 -f ./docker/Dockerfile .
Expand Down
5 changes: 3 additions & 2 deletions tools/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ printf "SEMVER = ${SEMVER}\n"
printf "VERSION = ${VERSION}\n"
printf "ARCH = ${ARCH}\n"
printf "PLATFORM = ${PLATFORM}\n"
printf "PROFILE = ${PROFILE}\n"

rm -rf ./build/dir_zip
rm -rf ./build/rabbithole-pg${VERSION}_${ARCH}-unknown-linux-gnu_${SEMVER}.zip
rm -rf ./build/dir_deb
rm -rf ./build/rabbithole-pg${VERSION}_${SEMVER}_${PLATFORM}.deb

mkdir -p ./build/dir_zip
cp ./target/schema.sql ./build/dir_zip/rabbithole--$SEMVER.sql
cp ./target/${ARCH}-unknown-linux-gnu/${PROFILE}/schema.sql ./build/dir_zip/rabbithole--$SEMVER.sql
sed -e "s/@CARGO_VERSION@/$SEMVER/g" < ./rabbithole.control > ./build/dir_zip/rabbithole.control
cp ./target/${ARCH}-unknown-linux-gnu/release/librabbithole.so ./build/dir_zip/rabbithole.so
cp ./target/${ARCH}-unknown-linux-gnu/${PROFILE}/librabbithole.so ./build/dir_zip/rabbithole.so
zip ./build/rabbithole-pg${VERSION}_${ARCH}-unknown-linux-gnu_${SEMVER}.zip -j ./build/dir_zip/*

mkdir -p ./build/dir_deb
Expand Down
2 changes: 1 addition & 1 deletion tools/schema.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ CONTROL_FILEPATH="./rabbithole.control" SO_FILEPATH="$DIR/librabbithole.so" $(di

PGRX_EMBED=$code cargo rustc --package rabbithole --bin pgrx_embed_rabbithole "$@" -- --cfg pgrx_embed

CARGO_PKG_VERSION="0.0.0" QEMU_LD_PREFIX=$QEMU_LD_PREFIX "${RUNNER[@]}" "$DIR/pgrx_embed_rabbithole" | expand -t 4 > ./target/schema.sql
CARGO_PKG_VERSION="0.0.0" QEMU_LD_PREFIX=$QEMU_LD_PREFIX "${RUNNER[@]}" "$DIR/pgrx_embed_rabbithole" | expand -t 4 > $DIR/schema.sql

0 comments on commit 176f1d1

Please sign in to comment.