-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (69 loc) · 2.55 KB
/
Copy pathflutter-build-android.yml
File metadata and controls
71 lines (69 loc) · 2.55 KB
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
name: Run flutter tests
on:
workflow_call:
inputs:
app-dir:
required: true
type: string
android_keystore_path:
required: true
default: 'upload.jks'
type: string
android_keystore_alias:
required: true
default: 'upload'
type: string
environment: # options development|staging|production
required: true
type: string
packageName: # this should be optional.. https://github.com/r0adkll/upload-google-play/issues/103
required: true
type: string
secrets:
android_key_asc:
required: true
android_key_passphrase:
required: true
android_keystore_private_key_password:
required: true
android_keystore_password:
required: true
play_store_gservice_account:
required: true
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available optionsjava-version
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: sh pre_build.sh ${{ inputs.environment }}
- run: sh cli.sh --init
- run: |
echo "${{secrets.android_key_asc}}" > upload.keystore.asc
gpg -d --passphrase "${{ secrets.android_key_passphrase }}" --batch upload.keystore.asc > 'android/app/'${{ inputs.android_keystore_path }}
working-directory: ${{ inputs.app-dir }}
- run: flutter build appbundle --release --flavor ${{ inputs.environment }} --target='lib/main_${{ inputs.environment }}.dart'
working-directory: ${{ inputs.app-dir }}
env:
ANDROID_KEYSTORE_PATH: ${{ inputs.android_keystore_path }}
ANDROID_KEYSTORE_ALIAS: ${{ inputs.android_keystore_alias }}
ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: ${{ secrets.android_keystore_private_key_password }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.android_keystore_password }}
- name: Release APPBUNDLE to internal track
uses: r0adkll/upload-google-play@v1.0.16
with:
serviceAccountJsonPlainText: ${{ secrets.play_store_gservice_account }}
releaseFile: ${{inputs.app-dir}}/build/app/outputs/bundle/productionRelease/app-production-release.aab
status: 'draft'
track: internal
packageName: ${{inputs.packageName}}
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db