b43601b4fd
- 新增 scripts/ci/provision-{mac,windows}.sh:幂等预置,按 Flutter 版本
stamp 短路,pipeline 首跑自动 precache + 预热缓存,运行时不再下载 engine
- scripts/ci/_env.sh:抽出共用镜像 env,compile 脚本统一 source
- deploy.yml:build-macos needs build-linux-web,同一 mac runner 串行
执行,避免排队超时;各 build job 加 Provision 前置步骤
- 删除 .gitea/workflows/ci.yml
- backup.yml:暂停定时备份(保留 workflow_dispatch 手动触发)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 lines
990 B
Bash
Executable File
44 lines
990 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# compile.sh <tag> — build backend + Flutter web, package into dist/
|
|
set -euo pipefail
|
|
|
|
# shellcheck source=scripts/ci/_env.sh
|
|
. "$(dirname "$0")/_env.sh"
|
|
|
|
TAG="$1"
|
|
VER="${TAG#v}"
|
|
|
|
echo "==> compile: version=$VER"
|
|
|
|
# Sync Flutter pubspec version
|
|
sed -i '' "s/^version:.*/version: ${VER}+1/" client/pubspec.yaml
|
|
|
|
# Build Go backend (linux/amd64 for EC2)
|
|
cd backend
|
|
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o jiu-server .
|
|
cd ..
|
|
|
|
# Build Flutter Web
|
|
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=${TAG}"
|
|
cd ..
|
|
|
|
# Build marketing site
|
|
cd web
|
|
npm ci --prefer-offline
|
|
npm run build
|
|
cd ..
|
|
|
|
# Package artifacts
|
|
mkdir -p dist
|
|
mv backend/jiu-server dist/jiu-server
|
|
tar -czf dist/web.tar.gz -C client/build web
|
|
tar -czf dist/marketing.tar.gz -C web/dist .
|
|
|
|
echo "==> compile: done — dist/ contents:"
|
|
ls -lh dist/
|