liyi 398c45ade1
Some checks failed
Flutter CI - Basic Setup / 🔧 Basic Setup (push) Failing after 3m32s
fix: 测试ci
2025-09-25 09:12:47 +08:00

97 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Flutter CI - Basic Setup
on:
push:
branches:
- develop_sky
jobs:
# 基础设置任务检出代码、提取版本号、输出Flutter环境
basic-setup:
name: 🔧 Basic Setup
runs-on: sky
steps:
# 1. 检出代码
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
# 2. 提取版本号
- name: Extract Version
id: version
run: |
# 获取最新的tag匹配vX.X.X_sky格式
LAST_TAG=$(git describe --tags --match "v*.*.*_sky" --abbrev=0 2>/dev/null || echo "v1.0.0_sky")
echo "📌 Last tag found: $LAST_TAG"
# 提取基础版本号去除_sky后缀
BASE_VERSION=$(echo "$LAST_TAG" | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
[ -z "$BASE_VERSION" ] && BASE_VERSION="v1.0.0"
echo "📌 Base version: $BASE_VERSION"
# 解析版本号各部分
MAJOR=$(echo $BASE_VERSION | cut -d'.' -f1 | sed 's/v//')
MINOR=$(echo $BASE_VERSION | cut -d'.' -f2)
PATCH=$(echo $BASE_VERSION | cut -d'.' -f3)
echo "📌 Version components: Major=$MAJOR, Minor=$MINOR, Patch=$PATCH"
# 输出版本信息
echo "✅ Version extraction completed"
# 3. 输出Flutter环境
- name: Output Flutter Environment
run: |
echo "🚀 Flutter Environment Information:"
echo "================================"
# 检查Flutter是否可用
if command -v flutter &> /dev/null; then
echo "✅ Flutter is available"
# 输出Flutter版本
flutter --version
echo ""
# 输出Flutter doctor信息
echo "📋 Flutter Doctor Summary:"
flutter doctor -v | head -20
echo ""
# 输出当前项目信息
echo "📁 Project Information:"
echo "Project directory: $(pwd)"
echo "Flutter project detected: $(ls -la | grep pubspec.yaml > /dev/null && echo "Yes" || echo "No")"
else
echo "❌ Flutter is not available in this environment"
fi
echo "✅ Flutter environment check completed"
# 4. 输出CI环境信息
- name: Output CI Environment
run: |
echo "🔧 CI Environment Information:"
echo "============================"
echo "Runner OS: $RUNNER_OS"
echo "Runner Architecture: $RUNNER_ARCH"
echo "Git Branch: $GITHUB_REF"
echo "Git SHA: $GITHUB_SHA"
echo "Workflow: $GITHUB_WORKFLOW"
echo ""
echo "✅ CI environment information output completed"
# 5. 任务完成通知
- name: Task Completion
run: |
echo "🎉 Basic CI setup completed successfully!"
echo ""
echo "📋 Tasks executed:"
echo " ✅ Code checkout"
echo " ✅ Version extraction"
echo " ✅ Flutter environment output"
echo " ✅ CI environment output"
echo ""
echo "🔚 No further operations will be performed."