Skip to content

IOS release

IOS release #26

Workflow file for this run

name: IOS release
on:
workflow_dispatch:
inputs:
build-name:
required: true
type: string
build-number:
required: true
type: string
workflow_call:
inputs:
build-name:
required: true
type: string
build-number:
required: true
type: string
concurrency:
group: ${{ github.workflow }}-ios-release-${{ github.head_ref }}
cancel-in-progress: true
# TODO https://damienaicheh.github.io/flutter/github/actions/2021/04/22/build-sign-flutter-ios-github-actions-en.html
jobs:
release-ios:
runs-on: macos-latest
timeout-minutes: 30
env:
APP_STORE_CONNECT_ISSUER_ID: "74f730c9-0d7e-4eff-b480-54f75e8945c8"
APP_STORE_CONNECT_KEY_IDENTIFIER: "W4B4G6CUU4"
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
CERTIFICATE_PRIVATE_KEY: ${{ secrets.APPLE_CERTIFICATE_PRIVATE_KEY }}
steps:
# Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
- name: Checkout repository
uses: actions/checkout@v4
# Install the Apple certificate and provisioning profile
- name: 🔑 Install the Apple certificate and provisioning profile
run: |
app-store-connect fetch-signing-files $(xcode-project detect-bundle-id) --platform IOS --type IOS_APP_STORE --create
xcode-project use-profiles --export-options-plist=$RUNNER_TEMP/export_options.plist --archive-method=app-store
keychain initialize -p $RUNNER_TEMP/build.keychain
keychain add-certificates -p $RUNNER_TEMP/build.keychain
curl -o $RUNNER_TEMP/AppleWWDRCAG3.cer https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
security import $RUNNER_TEMP/AppleWWDRCAG3.cer -k $RUNNER_TEMP/build.keychain -T /usr/bin/codesign
- name: 🧰 Setup app
uses: ./.github/actions/setup-app
# Build and sign the ipa using a single flutter command
- name: 🛠️ Building IPA
run: flutter build ipa --release --export-options-plist=$RUNNER_TEMP/export_options.plist --build-name=${{ inputs.build-name }} --build-number=${{ inputs.build-number }}
# Important! Cleanup: remove the certificate and provisioning profile from the runner!
- name: 🧹 Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
keychain delete -p $RUNNER_TEMP/build.keychain
security default-keychain -s login.keychain
- name: ⏫ Publishing app to TestFlight
env:
APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
IPA_PATH: build/ios/ipa/now-u.ipa
run: ./.github/scripts/publish_testflight.sh