Skip to content

v1.11.3

v1.11.3 #49

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:
- '**'
jobs:
get-version:
name: Get version
runs-on: ubuntu-latest
outputs:
buildName: ${{ steps.get_version.outputs.buildName }}
buildNumber: ${{ steps.get_version.outputs.buildNumber }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get version
id: get_version
run: |
# get buildName from pubspec.yaml (before the +)
buildName=$(grep -oP '(?<=version: ).*(?=\+)' pubspec.yaml)
echo "buildName=$buildName" >> $GITHUB_OUTPUT
# get buildNumber from pubspec.yaml (after the +)
buildNumber=$(grep -oP '(?<=version: ).*' pubspec.yaml | grep -oP '(?<=\+).*$')
echo "buildNumber=$buildNumber" >> $GITHUB_OUTPUT
build-ios:
name: Build for iOS
runs-on: macos-latest
needs: get-version
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@v3
- name: Setup cache
uses: actions/cache@v3
with:
path: |
build
key: ${{ runner.OS }}-ricochlime-macos-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
restore-keys: |
${{ runner.OS }}-ricochlime-macos-
- name: Remove dev dependencies
run: ./patches/remove_dev_dependencies.sh
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
- name: Install Codemagic CLI Tools
run: pipx install codemagic-cli-tools
- name: Setup keychain
run: |
keychain initialize
app-store-connect fetch-signing-files $(xcode-project detect-bundle-id) \
--platform IOS \
--type IOS_APP_STORE \
--certificate-key=@env:APP_STORE_CERTIFICATE_KEY \
--create
keychain add-certificates
xcode-project use-profiles
- run: flutter pub get
- run: find . -name "Podfile" -execdir pod install \;
- name: Build for iOS
id: build
run: |
flutter build ipa \
--export-options-plist=$HOME/export_options.plist
export ipaPath="Ricochlime_v${{ needs.get-version.outputs.buildName }}.ipa"
mv "$(find $(pwd) -name "*.ipa")" "$ipaPath"
echo "ipaPath=$ipaPath" >> $GITHUB_OUTPUT
- name: Restore keychain
run: |
keychain use-login
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Ricochlime-iOS-Archive
path: ${{ steps.build.outputs.ipaPath }}
- name: Publish to App Store
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: app-store-connect publish --path ${{ steps.build.outputs.ipaPath }}