moved rust prep stuff to flows repo
This commit is contained in:
27
flow
27
flow
@ -3,34 +3,15 @@
|
|||||||
# Flows
|
# Flows
|
||||||
source "flows/base"
|
source "flows/base"
|
||||||
source "flows/release"
|
source "flows/release"
|
||||||
|
source "flows/rust"
|
||||||
|
|
||||||
# Vars
|
# 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)
|
DEPENDENCIES=(cargo git icu4c pkg-config)
|
||||||
CARGO_DEPENDENCIES=(cargo-pgrx)
|
CARGO_DEPENDENCIES=(cargo-pgrx)
|
||||||
GITEA_ORGANIZATION="cellular"
|
GITEA_ORGANIZATION="cellular"
|
||||||
GITEA_REPOSITORY="jspg"
|
GITEA_REPOSITORY="jspg"
|
||||||
PACKAGE_NAME="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() {
|
postgres-prepare() {
|
||||||
echo -e "${BLUE}Checking PostgreSQL dependencies...${RESET}"
|
echo -e "${BLUE}Checking PostgreSQL dependencies...${RESET}"
|
||||||
if ! command -v pg_config &> /dev/null; then
|
if ! command -v pg_config &> /dev/null; then
|
||||||
@ -42,8 +23,6 @@ postgres-prepare() {
|
|||||||
echo -e "${GREEN}PostgreSQL dependencies met.${RESET}"
|
echo -e "${GREEN}PostgreSQL dependencies met.${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build function (used by release flow)
|
|
||||||
# Creates release artifacts in ./package/
|
|
||||||
build() {
|
build() {
|
||||||
local version
|
local version
|
||||||
version=$(get-version)
|
version=$(get-version)
|
||||||
@ -81,19 +60,16 @@ build() {
|
|||||||
echo -e "✨ ${GREEN}Build v$version complete. Artifacts ready in ./$PACKAGE_DIRECTORY/${RESET}"
|
echo -e "✨ ${GREEN}Build v$version complete. Artifacts ready in ./$PACKAGE_DIRECTORY/${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install for development (non-release)
|
|
||||||
install() {
|
install() {
|
||||||
echo -e "🔧 ${CYAN}Installing jspg extension (dev build)...${RESET}"
|
echo -e "🔧 ${CYAN}Installing jspg extension (dev build)...${RESET}"
|
||||||
cargo pgrx install "$@" # Pass any extra args like --debug
|
cargo pgrx install "$@" # Pass any extra args like --debug
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run tests
|
|
||||||
test() {
|
test() {
|
||||||
echo -e "🧪 ${CYAN}Running jspg tests...${RESET}"
|
echo -e "🧪 ${CYAN}Running jspg tests...${RESET}"
|
||||||
cargo pgrx test "$@" # Pass any extra args
|
cargo pgrx test "$@" # Pass any extra args
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean build artifacts
|
|
||||||
clean() {
|
clean() {
|
||||||
echo -e "🧹 ${CYAN}Cleaning build artifacts...${RESET}"
|
echo -e "🧹 ${CYAN}Cleaning build artifacts...${RESET}"
|
||||||
cargo pgrx clean
|
cargo pgrx clean
|
||||||
@ -109,7 +85,6 @@ usage() {
|
|||||||
echo -e " release Perform a full release (increments patch, builds, tags, pushes, packages)."
|
echo -e " release Perform a full release (increments patch, builds, tags, pushes, packages)."
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Command Dispatcher ---
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
prepare) base prepare; cargo-prepare; postgres-prepare;;
|
prepare) base prepare; cargo-prepare; postgres-prepare;;
|
||||||
install) install "${@:2}";;
|
install) install "${@:2}";;
|
||||||
|
|||||||
2
flows
2
flows
Submodule flows updated: 8431378080...24fc2538d4
Reference in New Issue
Block a user