fix(action): 尝试修复macos打包问题 #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: app-build-action-ios-dev | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'dev-ios' | |
| jobs: | |
| build-mac-ios: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # 签出代码 | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: dev-ios | |
| # 设置Flutter | |
| - name: Flutter action | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.32.8' | |
| cache: true | |
| # 设置JAVA环境 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: "17" | |
| cache: "gradle" | |
| # 打开MAC Desktop支持 | |
| - name: Enable Flutter Desktop | |
| run: flutter config --enable-macos-desktop | |
| # 更新Flutter的packages | |
| - name: Restore packages | |
| run: | | |
| cd simple_live_app | |
| flutter pub get | |
| # 安装appdmg npm install -g appdmg | |
| - name: Install appdmg | |
| run: npm install -g appdmg | |
| # 设置fast-forge环境 | |
| - name: Install fast-forge | |
| run: | | |
| git clone https://github.com/SlotSun/fastforge.git | |
| cd fastforge | |
| dart pub global activate melos | |
| melos run activate | |
| # 设置 xcode-version | |
| - name: Setup Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| #打包iOS | |
| - name: Build IPA | |
| run: | | |
| cd simple_live_app | |
| flutter build ios --release --no-codesign | |
| #创建未签名ipa | |
| - name: Create IPA | |
| run: | | |
| cd simple_live_app | |
| mkdir build/ios/iphoneos/Payload | |
| cp -R build/ios/iphoneos/Runner.app build/ios/iphoneos/Payload/Runner.app | |
| cd build/ios/iphoneos/ | |
| zip -q -r ios_no_sign.ipa Payload | |
| cd ../../.. | |
| # 上传IPA至Artifacts | |
| - name: Upload IPA to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios | |
| path: | | |
| simple_live_app/build/ios/iphoneos/ios_no_sign.ipa | |
| # 打包MAC | |
| - name: Build MacOS | |
| run: | | |
| cd simple_live_app | |
| fastforge package --platform macos --targets dmg,zip --skip-clean | |
| # 上传MAC至Artifacts | |
| - name: Upload MacOS to Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mac | |
| path: | | |
| simple_live_app/build/dist/*/*.dmg | |
| simple_live_app/build/dist/*/*.zip | |
| #完成 | |
| - run: echo "🍏 This job's status is ${{ job.status }}." |