-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (105 loc) · 4.38 KB
/
master.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Distribution
on: #events (push and pull_request)
push:
branches: [ "main" ]
#pull_request:
# branches: [ "main" ]
env:
PROPERTIES_PATH: "android/key.properties"
jobs: #here we specify the jobs - We could have multiple jobs
build-android: #name it something meaningful
runs-on: macos-latest #runner: select a machine to use
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '17.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
cache: true
- name: Install dependencies
run: flutter pub get # action
- name: Run clean
run: flutter clean
- name: Upload-keystore generator
run: |
echo "${{secrets.UPLOAD_KEYSTORE}}" > upload.keystore.asc
base64 -d --input upload.keystore.asc --output android/app/key.jks
- name: Key.Properties
run: |
echo keyPassword=\${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }} > ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.ALIAS }} >> ${{env.PROPERTIES_PATH}}
#- name: Run tests
# run: flutter test
- name: Build Android appBundle
run: flutter build appbundle --release
#- name: Build ios
# run: flutter build ios --release --no-codesign
- name: Upload AAB
id: uploadArtifact
uses: actions/upload-artifact@v1
with:
name: waves-android
path: build/app/outputs/bundle/release/app-release.aab
- name: Deploy to Play Store (BETA)
id: deploy
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.ecency.waves
releaseFiles: "build/app/outputs/bundle/release/app-release.aab"
track: internal
changesNotSentForReview: true
status: completed
build-ios:
runs-on: macos-latest
steps:
- name: Check out
uses: actions/checkout@v1
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.CERTIFICATES_P12 }}
P12_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE }}
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_APP_PASS }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Install dependencies
run: |
flutter pub get
dart pub add build_runner --dev
- name: Run build_runner build
run: dart run build_runner build --delete-conflicting-outputs
- name: Building IPA
run: |
flutter build ipa --release \
--export-options-plist=ios/Runner/ExportOptions.plist
- name: Upload to AppStoreConnect
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_PASS: ${{ secrets.APPLE_APP_PASS }}
run: xcrun altool --upload-app -f "build/ios/ipa/waves.ipa" -t ios -u "$APPLE_ID" -p "$APPLE_APP_PASS"