Skip to content

workflow (flutter): upgrade actions to latest and using ccache for iOS #34

workflow (flutter): upgrade actions to latest and using ccache for iOS

workflow (flutter): upgrade actions to latest and using ccache for iOS #34

name: Create an iOS Simulator build
on:
push:
paths:
- '*'
- '.github/workflows/build-ios-simulator.yml'
- 'lib/**'
- 'ios/**'
- '!**/*.md'
branches:
- flutter
jobs:
build-ios-simulator:
name: Create an iOS Simulator build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
# Setup the flutter environment.
- name: Setup Flutter environment
uses: subosito/flutter-action@v2
with:
cache: true
- uses: hendrikmuhs/[email protected]
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-ccache # makes a unique key w/related restore key internally
create-symlink: true
max-size: 1500M
- name: Restore Pods cache
uses: actions/cache@v4
with:
path: |
ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-
- name: Build iOS ipa
run: |
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
export CCACHE_LIMIT_MULTIPLE=0.95
ccache -s
set -o pipefail
flutter build ios --simulator --no-codesign --obfuscate --split-debug-info --config-only
ccache -s
- name: Store build .app file as zip
run: |
cd build/ios/iphonesimulator
mv Runner.app flutter_github_actions.app
mkdir -p output
zip -r -y -o output/flutter_github_actions.zip flutter_github_actions.app
- name: Save build file as artifact
uses: actions/upload-artifact@v4
with:
name: flutter_github_actions
path: build/ios/iphonesimulator/output