-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (73 loc) · 3.41 KB
/
release_to_dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release to Dev
on:
push:
branches:
- release_to_dev
jobs:
build:
runs-on: macOS-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read Flutter SDK version
run: echo "FLUTTER_VERSION=$(jq -r '.flutterSdkVersion' .fvm/fvm_config.json)" >> $GITHUB_ENV
shell: bash
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: flutter pub get (dart_flutter_common)
run: cd packages/dart_flutter_common && flutter pub get
- name: flutter pub get (firebase_common)
run: cd packages/firebase_common && flutter pub get
- name: flutter pub get (mottai_flutter_app)
run: cd packages/mottai_flutter_app && flutter pub get
- name: Create dev-dart-define.json from GitHub secret
run: cd packages/mottai_flutter_app && echo '${{ secrets.DEV_DART_DEFINE_JSON_STRING }}' > dev-dart-define.json
- name: Decode and install provisioning profile
run: |
echo ${{ secrets.DEV_APPLE_DISTRIBUTION_PROVISIONING_PROFILE_BASE64_STRING }} | base64 --decode > profile.mobileprovision
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/
- name: Run import-codesign-certs
uses: Apple-Actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.APPLE_DISTRIBUTION_CERTIFICATE_P12_BASE64_STRING }}
p12-password: ${{ secrets.APPLE_DISTRIBUTION_CERTIFICATE_P12_PASSWORD }}
- name: Create Environment.swift
run: |
echo "import Foundation" > packages/mottai_flutter_app/ios/Runner/Environment.swift
echo "struct Env {" >> packages/mottai_flutter_app/ios/Runner/Environment.swift
echo " static let googleMapApiKey = \"${{ secrets.DEV_GOOGLE_MAP_API_KEY }}\"" >> packages/mottai_flutter_app/ios/Runner/Environment.swift
echo "}" >> packages/mottai_flutter_app/ios/Runner/Environment.swift
- name: flutter build ipa
run: |
cd packages/mottai_flutter_app
flutter build ipa --release \
--dart-define-from-file="dev-dart-define.json" \
-t "lib/main.dart" \
--build-name=$(grep 'version:' pubspec.yaml | cut -d ' ' -f 2 | cut -d '+' -f 1) \
--build-number=$GITHUB_RUN_NUMBER \
--export-options-plist="ios/ExportOptions.plist"
- name: Save AuthKey.p8 file
run: |
mkdir -p packages/mottai_flutter_app/private_keys
echo "${{ secrets.DEV_IOS_AUTH_KEY }}" > packages/mottai_flutter_app/private_keys/AuthKey.p8
- name: Validate ipa
run: |
cd packages/mottai_flutter_app
xcrun altool --validate-app \
-f "./build/ios/ipa/mottai_dev.ipa" \
-t ios \
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \
--private-key "./private_keys/AuthKey.p8"
- name: Upload ipa to TestFlight
run: |
cd packages/mottai_flutter_app
xcrun altool --upload-app \
-f "./build/ios/ipa/mottai_dev.ipa" \
-t ios \
--apiKey ${{ secrets.DEV_IOS_API_KEY }} \
--apiIssuer ${{ secrets.DEV_IOS_API_ISSUER }} \
--private-key "./private_keys/AuthKey.p8"