-
Notifications
You must be signed in to change notification settings - Fork 22
68 lines (65 loc) · 2.18 KB
/
main.yml
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
name: Build Flutter APK's and iPA files
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
architecture: x64
cache: true
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '12.x'
cache: 'gradle'
- name: Run flutter doctor
run: flutter doctor -v
- name: Run pub get and build runner
run: |
flutter pub get
dart run build_runner build --delete-conflicting-outputs
- name: Write google-services file for Android
run: printf "${{ secrets.GOOGLE_SERVICE_ANDROID }}" > android/app/google-services.json
- name: Write firebase app id file for for iOS
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.FIREBASE_APP_ID }}
filename: "firebase_app_id_file.json"
is-executable: false
working-directory: "ios/firebase_app_id_file.json"
# run: printf "${{ secrets.FIREBASE_APP_ID }}" > ios/firebase_app_id_file.json
- name: Write GoogleService-Info.plist file for iOS
run: printf "${{ secrets.GOOGLE_INFO_PLIST_IOS }}" > ios/Runner/GoogleService-Info.plist
- name : Write firebase options file
run: printf "${{ secrets.FIREBASE_OPTIONS }}" > lib/firebase_options.dart
- name: Build APK
run: |
flutter build apk --release
cd build/app/outputs/apk/release
mv *.apk Medusa-Admin-${GITHUB_REF#refs/*/}.apk
- name: Build iPA
run: |
flutter build ios --release --no-codesign
cd build/ios/iphoneos
mkdir Payload
cd Payload
ln -s ../Runner.app
cd ..
zip -r Medusa-Admin-${GITHUB_REF#refs/*/}.ipa Payload
- name: Create Release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: "build/app/outputs/apk/release/*.apk,build/ios/iphoneos/*.ipa"
allowUpdates: true