increased ipa timeout

This commit is contained in:
Vadim 2024-02-11 20:47:37 +01:00
parent 9d1f87c156
commit a30b0a1749
2 changed files with 52 additions and 53 deletions

View file

@ -3,19 +3,29 @@
# separate terms of service, privacy policy, and support # separate terms of service, privacy policy, and support
# documentation. # documentation.
name: Build Prod .ipa name: Build .apk
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
env: flavor:
FLAVOR: "prod" description: 'Flavor'
type: choice
required: true
options:
- dev
- prod
default: 'dev'
include-iap:
type: boolean
description: Include IAP package
default: true
jobs: jobs:
build: build:
name: Build .ipa name: Build .apk
runs-on: macos-11 runs-on: macos-11
timeout-minutes: 20 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
@ -23,77 +33,66 @@ jobs:
- name: Connect private iap package - name: Connect private iap package
uses: webfactory/ssh-agent@v0.8.0 uses: webfactory/ssh-agent@v0.8.0
if: ${{ inputs.include-iap }}
with: with:
ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }} ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }}
- name: Override iap package with stub
if: ${{ !inputs.include-iap }}
run: bash ./.github/scripts/stub_iap.sh
- uses: actions/setup-java@v2 - uses: actions/setup-java@v2
with: with:
distribution: "zulu" distribution: "zulu"
java-version: "11" java-version: "11"
- name: Install the Apple certificate and provisioning profile - name: Restore Android keystore .jsk and .properties files
env: env:
APP_STORE_P12: ${{ secrets.APP_STORE_P12 }} KEYSTORE: ${{ secrets.KEYSTORE }}
APP_STORE_P12_PASSWORD: ${{ secrets.APP_STORE_P12_PASSWORD }} KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
APP_STORE_PROVISION_PROD: ${{ secrets.APP_STORE_PROVISION_PROD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: | run: |
# create variables KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 echo -n "$KEYSTORE" | base64 --decode --output $KEYSTORE_PATH
PROVISION_PATH=$RUNNER_TEMP/build_provision.mobileprovision cp $KEYSTORE_PATH ./android/app
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db KEYSTORE_PROPERTIES_PATH=$RUNNER_TEMP/key.properties
echo -n "$KEYSTORE_PROPERTIES" | base64 --decode --output $KEYSTORE_PROPERTIES_PATH
cp $KEYSTORE_PROPERTIES_PATH ./android
# import certificate and provisioning profile from secrets - name: Restore android/app/google-services.json
echo -n "$APP_STORE_P12" | base64 --decode -o $CERTIFICATE_PATH env:
echo -n "$APP_STORE_PROVISION_PROD" | base64 --decode -o $PROVISION_PATH GOOGLE_SERVICES_JSON_ANDROID: ${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}
run: |
# create temporary keychain GOOGLE_SERVICES_JSON_ANDROID_PATH=$RUNNER_TEMP/google-services.json
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH echo -n "$GOOGLE_SERVICES_JSON_ANDROID" | base64 --decode --output $GOOGLE_SERVICES_JSON_ANDROID_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH cp $GOOGLE_SERVICES_JSON_ANDROID_PATH ./android/app
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$APP_STORE_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PROVISION_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Restore ios/Runner/ExportOptions.plist
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.APP_STORE_EXPORT_OPTIONS }}" "ios/Runner/ExportOptions.plist"
- name: Restore firebase_options.dart - name: Restore firebase_options.dart
run: bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_OPTIONS }}" "lib/firebase_options.dart" env:
FIREBASE_OPTIONS: ${{ secrets.FIREBASE_OPTIONS }}
run: |
FIREBASE_OPTIONS_PATH=$RUNNER_TEMP/firebase_options.dart
echo -n "$FIREBASE_OPTIONS" | base64 --decode --output $FIREBASE_OPTIONS_PATH
cp $FIREBASE_OPTIONS_PATH ./lib
- name: Install Flutter - name: Install Flutter
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.10.0" flutter-version: '3.10.0'
- name: Prepare flutter project - name: Prepare flutter project
run: | run: |
flutter --version flutter --version
flutter pub get flutter pub get
flutter pub run intl_utils:generate flutter pub run intl_utils:generate
- name: Build .ipa - name: Build .apk
run: | env:
flutter build ipa \ FLAVOR: ${{ github.event.inputs.flavor }}
--release \ run: flutter build apk --release --flavor $FLAVOR -t lib/main_$FLAVOR.dart
--flavor $FLAVOR \
--target lib/main_$FLAVOR.dart \
--export-options-plist=ios/Runner/ExportOptions.plist
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: m3_lightmeter_$FLAVOR_ipa name: m3_lightmeter_${{ github.event.inputs.flavor }}_apk
path: build/ios/ipa/lightmeter.ipa path: build/app/outputs/flutter-apk/app-${{ github.event.inputs.flavor }}-release.apk
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_provision.mobileprovision

View file

@ -15,7 +15,7 @@ jobs:
build: build:
name: Build .ipa name: Build .ipa
runs-on: macos-11 runs-on: macos-11
timeout-minutes: 20 timeout-minutes: 60
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with: