develop_sky #3
@ -1,53 +1,19 @@
|
||||
# .gitea/workflows/flutter-ci.yml
|
||||
name: Flutter CI - Develop Sky
|
||||
|
||||
# 触发条件:仅当推送到 develop_sky 分支时
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop_sky
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build iOS & Android
|
||||
# 使用你之前配置的标签
|
||||
runs-on: sky,flutter
|
||||
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: sky
|
||||
steps:
|
||||
# 1. 检出代码
|
||||
- name: Checkout Code
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 2. 获取 Flutter 依赖
|
||||
- name: Setup Flutter
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||
- name: List files in the repository
|
||||
run: |
|
||||
flutter --version
|
||||
flutter pub get
|
||||
|
||||
# 3. 运行测试(可选,但推荐)
|
||||
- name: Run Tests
|
||||
run: flutter test
|
||||
|
||||
# 4. 分析代码(可选)
|
||||
- name: Analyze Code
|
||||
run: flutter analyze
|
||||
|
||||
# 5. 构建 iOS IPA
|
||||
- name: Build iOS (IPA)
|
||||
run: flutter build ipa --release --export-method ad-hoc
|
||||
|
||||
# 6. 构建 Android APK 和 AAB
|
||||
- name: Build Android (APK & AAB)
|
||||
run: |
|
||||
flutter build apk --release
|
||||
flutter build appbundle --release
|
||||
|
||||
# 7. 上传所有构建产物
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: flutter-builds
|
||||
path: |
|
||||
build/app/outputs/flutter-apk/
|
||||
build/app/outputs/bundle/
|
||||
build/ios/ipa/
|
||||
ls ${{ gitea.workspace }}
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
Loading…
x
Reference in New Issue
Block a user