moved rust prep stuff to flows repo
This commit is contained in:
27
flow
27
flow
@ -3,34 +3,15 @@
|
||||
# Flows
|
||||
source "flows/base"
|
||||
source "flows/release"
|
||||
source "flows/rust"
|
||||
|
||||
# Vars
|
||||
# pg_config is tricky as it's not always just a command but needs PATH setup
|
||||
# We check for it specifically in the prepare function.
|
||||
DEPENDENCIES=(cargo git icu4c pkg-config)
|
||||
CARGO_DEPENDENCIES=(cargo-pgrx)
|
||||
GITEA_ORGANIZATION="cellular"
|
||||
GITEA_REPOSITORY="jspg"
|
||||
PACKAGE_NAME="jspg"
|
||||
|
||||
cargo-prepare() {
|
||||
echo -e "${BLUE}Checking Cargo dependencies...${RESET}"
|
||||
for DEP in "${CARGO_DEPENDENCIES[@]}"; do \
|
||||
if ! command -v "${DEP}" &> /dev/null; then \
|
||||
echo -e "${YELLOW}Attempting to install ${DEP} via cargo...${RESET}"; \
|
||||
if cargo install "${DEP}"; then
|
||||
echo -e "✅ ${GREEN}${DEP}: installed via cargo${RESET}"; \
|
||||
else
|
||||
echo -e "❌ ${RED}${DEP}: failed to install via cargo${RESET}"; \
|
||||
exit 1; \
|
||||
fi
|
||||
else \
|
||||
echo -e "✅ ${GREEN}${DEP}: installed${RESET}"; \
|
||||
fi \
|
||||
done
|
||||
echo -e "${GREEN}All Cargo dependencies met.${RESET}"
|
||||
}
|
||||
|
||||
postgres-prepare() {
|
||||
echo -e "${BLUE}Checking PostgreSQL dependencies...${RESET}"
|
||||
if ! command -v pg_config &> /dev/null; then
|
||||
@ -42,8 +23,6 @@ postgres-prepare() {
|
||||
echo -e "${GREEN}PostgreSQL dependencies met.${RESET}"
|
||||
}
|
||||
|
||||
# Build function (used by release flow)
|
||||
# Creates release artifacts in ./package/
|
||||
build() {
|
||||
local version
|
||||
version=$(get-version)
|
||||
@ -81,19 +60,16 @@ build() {
|
||||
echo -e "✨ ${GREEN}Build v$version complete. Artifacts ready in ./$PACKAGE_DIRECTORY/${RESET}"
|
||||
}
|
||||
|
||||
# Install for development (non-release)
|
||||
install() {
|
||||
echo -e "🔧 ${CYAN}Installing jspg extension (dev build)...${RESET}"
|
||||
cargo pgrx install "$@" # Pass any extra args like --debug
|
||||
}
|
||||
|
||||
# Run tests
|
||||
test() {
|
||||
echo -e "🧪 ${CYAN}Running jspg tests...${RESET}"
|
||||
cargo pgrx test "$@" # Pass any extra args
|
||||
}
|
||||
|
||||
# Clean build artifacts
|
||||
clean() {
|
||||
echo -e "🧹 ${CYAN}Cleaning build artifacts...${RESET}"
|
||||
cargo pgrx clean
|
||||
@ -109,7 +85,6 @@ usage() {
|
||||
echo -e " release Perform a full release (increments patch, builds, tags, pushes, packages)."
|
||||
}
|
||||
|
||||
# --- Command Dispatcher ---
|
||||
case "$1" in
|
||||
prepare) base prepare; cargo-prepare; postgres-prepare;;
|
||||
install) install "${@:2}";;
|
||||
|
||||
Reference in New Issue
Block a user