Skip to content

v1.29.2

v1.29.2 #220

Workflow file for this run

name: Build for iOS
# Using instructions from
# https://docs.flutter.dev/deployment/ios#create-a-build-archive-with-codemagic-cli-tools
on:
# Enable manual run
workflow_dispatch:
push:
tags:
- "**"
branches:
- "**"
paths:
- .github/workflows/ios.yml
jobs:
build-ios:
name: Build for iOS
runs-on: macos-latest
permissions:
contents: write
timeout-minutes: 60
env:
APP_STORE_CONNECT_ISSUER_ID: ${{secrets.APP_STORE_CONNECT_ISSUER_ID}}
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{secrets.APP_STORE_CONNECT_KEY_IDENTIFIER}}
APP_STORE_CONNECT_PRIVATE_KEY: ${{secrets.APP_STORE_CONNECT_PRIVATE_KEY}}
APP_STORE_CERTIFICATE_KEY: ${{secrets.APP_STORE_CERTIFICATE_KEY}}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Xcode
run: |
echo "Selecting Xcode 16.4..."
sudo xcode-select -s /Applications/Xcode_16.4.app
xcode-select -p
echo
echo "Running Xcode first launch..."
xcodebuild -runFirstLaunch
echo
echo "Downloading iOS platform files..."
xcodebuild -downloadPlatform iOS -version 18.0
echo
- name: Setup Flutter
uses: adil192/setup-flutter-submodule@v1
with:
flutter-path: submodules/flutter
- name: Install Codemagic CLI Tools
run: pipx install codemagic-cli-tools
- name: Setup keychain
run: |
keychain initialize
app-store-connect fetch-signing-files com.adilhanney.saber \
--platform IOS \
--type IOS_APP_STORE \
--certificate-key=@env:APP_STORE_CERTIFICATE_KEY \
--create
keychain add-certificates
xcode-project use-profiles --project ios/*.xcodeproj
- name: Disable Flutter CLI animations
run: flutter config --no-cli-animations
- run: flutter pub get
- name: Remove development dependencies
run: ./patches/remove_dev_dependencies.sh
- name: Build for iOS
run: |
flutter build ipa \
--dart-define=FLAVOR="App Store" \
--dart-define=APP_STORE="App Store" \
--dart-define=UPDATE_CHECK="false" \
--export-options-plist=$HOME/export_options.plist
- name: Move IPA
id: move
run: |
brew install grep
buildName=$(ggrep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
export ipaPath="Saber_v${buildName}.ipa"
mv $(find $(pwd) -name "*.ipa") $ipaPath
echo "ipaPath=$ipaPath" >> $GITHUB_OUTPUT
- name: Restore keychain
run: keychain use-login
- name: Upload debug files to Sentry
run: |
brew install sentry-cli
sentry-cli debug-files upload --include-sources build/ios/
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: saber-yf
SENTRY_PROJECT: saber
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: Saber-iOS-Archive
path: ${{ steps.move.outputs.ipaPath }}
- name: Upload to GitHub release
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.move.outputs.ipaPath }}
- name: Publish to App Store
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: app-store-connect publish --path ${{ steps.move.outputs.ipaPath }}