Skip to content

Flutter_iOS

Flutter_iOS #13

Workflow file for this run

name: Flutter_iOS
on: workflow_dispatch
# push:
# branches: [master]
permissions: write-all
jobs:
build_ios:
runs-on: macos-latest
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Change Version info
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
python3 ./ios-build-tools/addBuildNumber.py
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .
git commit -m "Update build number"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Change Develop to Distribution
run: |
python3 ./ios-build-tools/toDistribution.py
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.P12_BASE64 }}
p12-password: ${{ secrets.P12_PASSWORD }}
- name: Install the provisioning profile
env:
PROVISIONING_CERTIFICATE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
run: |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
echo -n "$PROVISIONING_CERTIFICATE_BASE64" | base64 --decode --output $PP_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install and set Flutter version
uses: subosito/[email protected]
with:
flutter-version: '3.13.7'
- name: Restore packages
run: flutter pub get
- name: Build Flutter
run: flutter build ios --release --no-codesign
- name: Build resolve Swift dependencies
run: xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme Runner -configuration Release
- name: Build xArchive
run: |
xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner -configuration Release DEVELOPMENT_TEAM="M5APZD5CKA" -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE="6145142a-0edd-4eac-a77e-fff7d043e943" clean archive CODE_SIGN_IDENTITY="iPhone Distribution: ziqi wei"
- name: Export ipa
run: xcodebuild -exportArchive -archivePath build-output/app.xcarchive -exportPath build-output/ios -exportOptionsPlist ios/ExportOptions.plist
# - name: Publish iOS Artifacts
# uses: actions/upload-artifact@v1
# with:
# name: release-ios
# path: build-output/ios
- name: Deploy to App Store (Testflight)
uses: apple-actions/upload-testflight-build@v1
with:
app-path: ${{ github.workspace }}/build-output/ios/life.mysit.SITLife.ipa
issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
api-key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
api-private-key: ${{ secrets.APP_STORE_CONNECT_API_PRIVATE_KEY }}