#!/usr/bin/env bash # compile-client-web.sh — build the Flutter Web app into dist/web.tar.gz. # Client pipeline (client-v*). Served at /app by nginx. set -euo pipefail # shellcheck source=scripts/ci/_env.sh . "$(dirname "$0")/_env.sh" TAG="$1" VER="${TAG#client-v}" echo "==> compile-client-web: version=${VER}" # Sync Flutter pubspec version (BSD sed on macOS) sed -i '' "s/^version:.*/version: ${VER}+1/" client/pubspec.yaml cd client flutter build web --release \ --base-href=/app/ \ "--dart-define=BASE_URL=https://jiu.51yanmei.com" \ "--dart-define=PUBLIC_URL=https://jiu.51yanmei.com" \ "--dart-define=APP_VERSION=v${VER}" cd .. mkdir -p dist tar -czf dist/web.tar.gz -C client/build web echo "==> compile-client-web: done — dist/ contents:" ls -lh dist/