#!/bin/bash
# 快速发布脚本

VERSION=$1
ENV=$2

if [ -z "$VERSION" ] || [ -z "$ENV" ]; then
    echo "用法: ./quick-release.sh <版本号> <环境>"
    echo "环境选项: dev/staging/prod"
    exit 1
fi

case $ENV in
    canary)
        git checkout main
        git tag "v${VERSION}-canary"
        git push canary main --tags
        ;;
    dev)
        git checkout main
        git tag "v${VERSION}-dev"
        git push dev main --tags
        ;;
    beta)
        git checkout main
        git tag "v${VERSION}-beta"
        git push beta main --tags
        ;;
    *)
        echo "无效的环境选项: canary/dev/beta"
        exit 1
        ;;
esac

echo "✅ 发布完成: v${VERSION}-${ENV}"
