-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 2.25 KB
/
build_for_android.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
name: build_for_android
on:
workflow_dispatch:
push:
tag:
- "v*.*.*"
jobs:
build_aab:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.8'
- run: flutter pub get
- name: Decrypt keys
run: |
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" > android/release.keystore.asc
echo "${{ secrets.KEY_PROPERTIES }}" > android/key.properties.asc
gpg -d --passphrase "${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSPHRASE }}" --batch android/release.keystore.asc > android/app/release.keystore
gpg -d --passphrase "${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSPHRASE }}" --batch android/key.properties.asc > android/key.properties
gpg -d --passphrase "${{ secrets.GOOGLE_SERVICES_KEY }}" --batch android/app/google-services.json.asc > android/app/google-services.json
# - run: flutter test
- name: Get Tag name (version code)
uses: olegtarasov/[email protected]
id: tagName
with:
tagRegex: 'v([0-9]+.[0-9]+.[0-9]+)' # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
tagRegexGroup: 1 # Optional. Default is 1.
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Build AAB
run: flutter build appbundle --release --build-number ${{ steps.date.outputs.date }}01 --build-name ${{ env.GIT_TAG_NAME }}
- name: Build APK
run: flutter build apk --release --build-number ${{ steps.date.outputs.date }}01 --build-name ${{ env.GIT_TAG_NAME }}
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/bundle/release/*.aab,build/app/outputs/bundle/release/*.apk"
- name: Save APPBUNDLE to Artifacts
uses: actions/upload-artifact@v2
with:
tag: ${{ env.GIT_TAG_NAME }}
name: APPBUNDLE
path: build/app/outputs/bundle/release/app-release.aab