Skip to content

fix: Spinner stuck on iOS (#3762) #2135

fix: Spinner stuck on iOS (#3762)

fix: Spinner stuck on iOS (#3762) #2135

name: Build staging iOS project
on:
workflow_dispatch:
inputs:
force-build:
description: 'Forces a new build and ignores the cache'
required: false
type: choice
default: false
options:
- true
- false
push:
branches:
- master
- release/**
jobs:
build-ios:
name: Build iOS
strategy:
fail-fast: false
matrix:
org: [atb, nfk, fram]
environment: ${{ matrix.org }}
timeout-minutes: 360
runs-on: macOS-12
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Add Entur private registry credentials
run: sh ./scripts/add-entur-private-registry.sh
env:
ENTUR_REGISTRY_USER: ${{ secrets.ENTUR_REGISTRY_USER }}
ENTUR_REGISTRY_TOKEN: ${{ secrets.ENTUR_REGISTRY_TOKEN }}
- name: Setup build dependencies, environment and assets
uses: ./.github/actions/ios-build-setup
with:
use-build-cache: 'true'
app-environment: 'staging'
app-org: ${{ matrix.org }}
git-crypt-key: ${{ secrets.GIT_CRYPT_KEY }}
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.MATCH_SSH_PRIVATE_KEY }}
- name: Get potential cached ipa & dsym
uses: actions/cache@v3
id: ipa-cache
with:
path: |
AtB.ipa
AtB.app.dSYM.zip
key: ${{ matrix.org }}-${{ runner.os }}-ios-cache-${{ hashFiles('ios/**') }}-${{ hashFiles('.yalc/**') }}-${{ hashFiles('.env') }}-${{ hashFiles('assets/') }}
- name: Generate native assets
if: inputs.force-build == 'true' || steps.ipa-cache.outputs.cache-hit != 'true'
run: brew install imagemagick && yarn generate-native-assets
- name: Disable widget
if: ${{ env.ENABLE_WIDGET != 'true' }}
run: bundle exec configure_extensions remove ios/atb.xcodeproj app departureWidget AtbAppIntent
- name: Run fastlane build
if: inputs.force-build == 'true' || steps.ipa-cache.outputs.cache-hit != 'true'
run: bundle exec fastlane ios build
env:
# A workaround for Github Actions which breaks for a timeout in some cases,
# so this sets a higher value for TIMEOUT and reduces the number of retries
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 180
FASTLANE_XCODEBUILD_SETTINGS_RETRIES: 1
EXPORT_METHOD: 'ad-hoc'
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
- name: Run fastlane cert match
if: inputs.force-build == 'false' || steps.ipa-cache.outputs.cache-hit == 'true'
run: bundle exec fastlane ios get_certs
env:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
- name: Replace ipa bundle
if: inputs.force-build == 'false' || steps.ipa-cache.outputs.cache-hit == 'true'
run: sh ./scripts/ios/replace-bundle.sh
env:
IPA_FILE_NAME: 'AtB.ipa'
APP_NAME: 'AtB.app'
- name: Distribute to Firebase App Distribution
if: matrix.org != 'atb'
run: |
echo ${{ secrets.FIREBASE_DISTRIBUTION_CREDENTIALS}} | base64 --decode > google-services.json
bundle exec fastlane ios firebase_distribution_staging
env:
GCP_CREDENTIALS_PATH: google-services.json
FIREBASE_APP_ID_IOS: ${{ secrets.FIREBASE_APP_ID_IOS }}
- name: Distribute to AppCenter
if: matrix.org == 'atb'
run: bundle exec fastlane ios appcenter_staging
env:
APPCENTER_API_KEY: ${{ secrets.APPCENTER_IOS_API_KEY }}
- name: Create bundle and source maps
if: inputs.force-build == 'true' || steps.ipa-cache.outputs.cache-hit != 'true'
run: sh ./scripts/ios/create-sourcemaps.sh
- name: Upload bundle and source maps
run: sh ./scripts/ios/upload-sourcemaps.sh
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
- name: Upload dSYMs
if: inputs.force-build == 'true' || steps.ipa-cache.outputs.cache-hit != 'true'
run: sh ./scripts/ios/upload-dsyms.sh
env:
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
- name: Register app version
run: sh ./scripts/ios/register-app-version.sh
env:
ENTUR_CLIENT_ID: ${{ secrets.ABT_ENTUR_CLIENT_ID_STAGING}}
ENTUR_CLIENT_SECRET: ${{ secrets.ABT_ENTUR_CLIENT_SECRET_STAGING}}