@@ -57,66 +57,74 @@ publish_package() {
5757 local FORGEBOX_USER=$3
5858 local FORGEBOX_PASS=$4
5959 local FORCE=$5
60-
60+ local MARK_STABLE=$6
61+
6162 echo " =========================================="
6263 echo " Publishing $PACKAGE_NAME to ForgeBox"
6364 echo " Directory: $PACKAGE_DIR "
65+ echo " Mark as Stable: $MARK_STABLE "
6466 echo " =========================================="
65-
67+
6668 # Check if directory exists
6769 if [ ! -d " $PACKAGE_DIR " ]; then
6870 echo " ERROR: Directory $PACKAGE_DIR does not exist!"
6971 exit 1
7072 fi
71-
73+
7274 # Check if box.json exists
7375 if [ ! -f " $PACKAGE_DIR /box.json" ]; then
7476 echo " ERROR: box.json not found in $PACKAGE_DIR !"
7577 exit 1
7678 fi
77-
79+
7880 # Verify package contents
7981 if ! verify_package_contents " $PACKAGE_DIR " " $PACKAGE_NAME " ; then
8082 echo " ERROR: Package verification failed!"
8183 exit 1
8284 fi
83-
85+
8486 # Change to the package directory
8587 cd " $PACKAGE_DIR "
86-
88+
8789 # Display box.json for verification
8890 echo " "
8991 echo " box.json contents:"
9092 cat box.json | jq ' .'
9193 echo " "
92-
94+
9395 # Check for directory/package directives in box.json
9496 if grep -q ' "directory"' box.json || grep -q ' "package"' box.json; then
9597 echo " WARNING: box.json contains directory/package directives that might cause issues!"
9698 fi
97-
99+
98100 # Login to ForgeBox first
99101 echo " Logging into ForgeBox..."
100102 box forgebox login username=" $FORGEBOX_USER " password=" $FORGEBOX_PASS "
101-
103+
102104 if [ $? -ne 0 ]; then
103105 echo " ✗ Failed to login to ForgeBox"
104106 exit 1
105107 fi
106108 echo " ✓ Successfully logged into ForgeBox"
107-
109+
108110 # Build the publish command with verbose output
109111 PUBLISH_CMD=" box publish --verbose"
110-
112+
111113 # Add force flag if requested
112114 if [ " $FORCE " == " true" ]; then
113115 PUBLISH_CMD=" $PUBLISH_CMD --force"
114116 fi
115-
117+
118+ # Add stableVersion flag if requested
119+ if [ " $MARK_STABLE " == " true" ]; then
120+ PUBLISH_CMD=" $PUBLISH_CMD --stableVersion"
121+ echo " Note: This version will be marked as stable/current in ForgeBox"
122+ fi
123+
116124 # Execute the publish command
117125 echo " Executing: $PUBLISH_CMD "
118126 $PUBLISH_CMD
119-
127+
120128 # Check if publish was successful
121129 if [ $? -eq 0 ]; then
122130 echo " ✓ Successfully published $PACKAGE_NAME to ForgeBox"
@@ -126,47 +134,65 @@ publish_package() {
126134 box forgebox logout
127135 exit 1
128136 fi
129-
137+
130138 # Return to original directory
131139 cd - > /dev/null
132-
140+
133141 echo " "
134142}
135143
136144# Main script
137145main () {
138146 # Check if we have the required arguments
139147 if [ " $# " -lt 2 ]; then
140- echo " Usage: $0 <forgebox_user> <forgebox_pass> [force]"
148+ echo " Usage: $0 <forgebox_user> <forgebox_pass> [force] [mark_stable]"
149+ echo " "
150+ echo " Arguments:"
151+ echo " forgebox_user - ForgeBox username"
152+ echo " forgebox_pass - ForgeBox password"
153+ echo " force - Force publish (true/false, default: false)"
154+ echo " mark_stable - Mark version as stable/current (true/false, default: false)"
155+ echo " "
156+ echo " Examples:"
157+ echo " $0 myuser mypass # Basic publish"
158+ echo " $0 myuser mypass true # Force publish"
159+ echo " $0 myuser mypass true true # Force publish and mark stable"
141160 exit 1
142161 fi
143-
162+
144163 FORGEBOX_USER=$1
145164 FORGEBOX_PASS=$2
146165 FORCE=${3:- false}
147-
166+ MARK_STABLE=${4:- false}
167+
148168 # Get the root directory (three levels up from tools/build/scripts)
149169 SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
150170 ROOT_DIR=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
151-
171+
172+ echo " =========================================="
173+ echo " ForgeBox Publishing Configuration"
174+ echo " =========================================="
152175 echo " Publishing packages from: $ROOT_DIR "
176+ echo " Force publish: $FORCE "
177+ echo " Mark as stable: $MARK_STABLE "
153178 echo " "
154-
179+
155180 # Publish Wheels Base Template
156- publish_package " Wheels Base Template" " $ROOT_DIR /build-wheels-base" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE "
157-
181+ publish_package " Wheels Base Template" " $ROOT_DIR /build-wheels-base" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE " " $MARK_STABLE "
182+
158183 # Publish Wheels Core
159- publish_package " Wheels Core" " $ROOT_DIR /build-wheels-core/wheels" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE "
160-
184+ publish_package " Wheels Core" " $ROOT_DIR /build-wheels-core/wheels" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE " " $MARK_STABLE "
185+
161186 # Publish Wheels CLI
162- publish_package " Wheels CLI" " $ROOT_DIR /build-wheels-cli/wheels-cli" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE "
163-
164- publish_package " Wheels Starter App" " $ROOT_DIR /build-wheels-starterApp" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE "
187+ publish_package " Wheels CLI" " $ROOT_DIR /build-wheels-cli/wheels-cli" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE " " $MARK_STABLE "
188+
189+ # Publish Wheels Starter App
190+ publish_package " Wheels Starter App" " $ROOT_DIR /build-wheels-starterApp" " $FORGEBOX_USER " " $FORGEBOX_PASS " " $FORCE " " $MARK_STABLE "
165191
166192 # Log out of ForgeBox
167193 echo " Logging out of ForgeBox..."
168194 box forgebox logout
169-
195+
170196 echo " =========================================="
171197 echo " All packages published successfully!"
172198 echo " =========================================="
0 commit comments