develop_sky #3
@ -1,53 +1,19 @@
|
|||||||
# .gitea/workflows/flutter-ci.yml
|
name: Gitea Actions Demo
|
||||||
name: Flutter CI - Develop Sky
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||||
|
on: [push]
|
||||||
# 触发条件:仅当推送到 develop_sky 分支时
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop_sky
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
Explore-Gitea-Actions:
|
||||||
name: Build iOS & Android
|
runs-on: sky
|
||||||
# 使用你之前配置的标签
|
|
||||||
runs-on: sky,flutter
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# 1. 检出代码
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||||
- name: Checkout Code
|
- 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
|
uses: actions/checkout@v4
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||||
# 2. 获取 Flutter 依赖
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||||
- name: Setup Flutter
|
- name: List files in the repository
|
||||||
run: |
|
run: |
|
||||||
flutter --version
|
ls ${{ gitea.workspace }}
|
||||||
flutter pub get
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|
||||||
# 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/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user