echo "git commit -a -m \"Updated version and assets for release ${version}\""
echo ""
+echo -e "\e[1m\e[94m== Build and upload bundles ==\e[0m"
+echo "bookstack-store-vendor"
+echo ""
+
echo -e "\e[1m\e[94m== Tag release and push it to GitHub ==\e[0m"
echo "git tag -a ${version} -m \"Release ${version}\" -s"
echo "git push origin release"
echo -e "\e[1m\e[94m== Post Deployment Checklist ==\e[0m"
echo "✔ Create GitHub release - https://github.com/BookStackApp/BookStack/releases/new?tag=${version}&title=BookStack+${version}"
echo "✔ Deploy site blogpost/changes"
-echo "✔ Post on Twitter - https://twitter.com/share?url=${blogpost_url}"
echo "✔ Post on Mastodon - https://fosstodon.org/share?url=${blogpost_url}"
echo "✔ Post on Subreddit - http://www.reddit.com/r/BookStack/submit?url=${blogpost_url}"
echo "✔ Update demo instance"
--- /dev/null
+#!/bin/bash
+
+TARGET_HOST="bs-site"
+TARGET_DIR="/var/www/files.bookstackapp.com/vendor"
+
+# Ensure the current working dir is a BookStack install
+if [ ! -f "version" ] || [ ! -f "composer.lock" ]; then
+ echo "Error: Are you in a BookStack install directory? Could not find version or compose.lock files"
+ exit 1
+fi
+
+# Get the version from file and trim whitespace
+VERSION=$(cat version | tr -d '[:space:]')
+if [[ $VERSION != v* ]]; then
+ echo "Error: Found version ($VERSION) does not appear to be valid"
+ exit 1
+fi
+
+echo "Rebuilding vendor directory..."
+rm -rf "vendor"
+composer install --no-dev
+
+echo "Creating ${ZIP_FILENAME}..."
+ZIP_FILENAME="${VERSION}.zip"
+zip -r "${ZIP_FILENAME}" vendor/
+if [ ! -f "${ZIP_FILENAME}" ]; then
+ echo "Error: Failed to create ZIP file"
+ exit 1
+fi
+
+echo "Saving SHA-256 has of ZIP to vendor_hash file..."
+ZIP_SHA=$(sha256sum "${ZIP_FILENAME}" | cut -d ' ' -f 1)
+echo -n "$ZIP_SHA" > vendor_hash
+
+echo "Checking if ZIP already exists on server..."
+if ssh "${TARGET_HOST}" "test -e ${TARGET_DIR}/${ZIP_FILENAME}"; then
+ echo "Error: ZIP file already exists at ${TARGET_DIR}/${ZIP_FILENAME}"
+ exit 1
+fi
+
+echo "Uploading ${ZIP_FILENAME} to server..."
+scp "${ZIP_FILENAME}" "${TARGET_HOST}:${TARGET_DIR}/${ZIP_FILENAME}"
+UPLOAD_RESULT="$?"
+if [ $UPLOAD_RESULT -ne 0 ]; then
+ #statements
+ echo "Error: Upload via scp failed with error code ${UPLOAD_RESULT}"
+ exit 1
+fi
+
+echo "Vendor ZIP creation and update complete!"
+echo "File stored at: https://files.bookstackapp.com/vendor/${ZIP_FILENAME}"
+echo "File sha256: ${ZIP_SHA}"
\ No newline at end of file