Skip to content

Setup Flutter Platforms and Build #2

Setup Flutter Platforms and Build

Setup Flutter Platforms and Build #2

Workflow file for this run

name: Setup Flutter Platforms and Build
on:
workflow_dispatch:
permissions:
contents: write
jobs:
setup-and-build:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.7'
- name: Enable iOS support
run: |
if [ ! -d "ios" ]; then
flutter create --platforms ios .
echo "iOS support enabled"
else
echo "iOS already configured"
fi
- name: Build iOS (debug)
run: |
flutter build ios --debug --no-codesign
echo "iOS build completed"
- name: Check for changes
id: check-changes
run: |
git status --porcelain
if git status --porcelain | grep -q .; then
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Configure Git
if: steps.check-changes.outputs.changes_detected == 'true'
run: |
git config --global user.name "ILoveScratch"
git config --global user.email "yaowendao2023@qq.com"
- name: Commit and push changes
if: steps.check-changes.outputs.changes_detected == 'true'
run: |
git add .
git commit -m "chore: enable iOS platforms"
git push https://github.com/ILoveScratch2/TouchFish-Client.git