File size: 1,766 Bytes
81e8bb6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #!/bin/bash
# ATOM AI Web Development Studio - One-Click Release Builder
# Usage: ./scripts/create-release.sh [version]
set -e
VERSION=${1:-"0.1.0-alpha.1"}
BUILD_DIR="dist/atom-desktop-$VERSION"
NEXTJS_DIR="frontend-nextjs"
TAURI_DIR="frontend-nextjs/src-tauri"
# Ensure we are in the project root
if [ ! -d "$NEXTJS_DIR" ]; then
echo "β Error: Could not find $NEXTJS_DIR. Please run this script from the project root."
exit 1
fi
echo "π Building ATOM Desktop App v$VERSION"
# Clean build directory
rm -rf dist
mkdir -p "$BUILD_DIR"
# Build Next.js
echo "ποΈ Building Next.js application..."
cd "$NEXTJS_DIR"
npm ci
# Backup config and switch to static export config
if [ -f "next.config.js" ]; then
mv next.config.js next.config.js.bak
fi
cat > next.config.js << EOF
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
images: { unoptimized: true },
typescript: { ignoreBuildErrors: true },
eslint: { ignoreDuringBuilds: true },
};
module.exports = nextConfig;
EOF
# Build static export
npm run build
# Restore config
rm next.config.js
if [ -f "next.config.js.bak" ]; then
mv next.config.js.bak next.config.js
fi
# Build Tauri
echo "π» Building desktop applications..."
# Stay in frontend-nextjs directory to run tauri
# npm run tauri build automatically looks for src-tauri
npm run tauri build
cd ..
# Copy artifacts
echo "π¦ Collecting artifacts..."
# Find the created bundle
FIND_CMD="find $TAURI_DIR/target/release/bundle -type f \( -name '*.dmg' -o -name '*.app' -o -name '*.msi' -o -name '*.deb' -o -name '*.AppImage' \)"
eval $FIND_CMD | while read -r file; do
echo "Found artifact: $file"
cp "$file" "$BUILD_DIR/"
done
echo "β
Release build complete in $BUILD_DIR"
|