-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 3.35 KB
/
main.yml
File metadata and controls
89 lines (76 loc) · 3.35 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: "Build Flutter APK's and App bundle"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "develop" branch
workflow_dispatch:
inputs:
build_name:
description: 'Build Name'
required: true
default: '1.0.0'
build_number:
description: 'Build Number'
required: true
default: '1'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: write
env:
AZ_API_KEY: ${{ secrets.AZ_API_KEY }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
# Set up Flutter.
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- run: flutter doctor -v
# Checkout the repository code and get packages.
- name: Checkout flutter_app code
uses: actions/checkout@v3
- run: flutter pub get
# Create the keystore file
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'android_keystore.jks'
fileDir: '/home/runner/work/Timukas/Timukas/android/app/keystore/'
encodedString: ${{ secrets.KEYSTORE }}
- name: Create .env file
run: echo "AZ_API_KEY=$AZ_API_KEY" > .env
- name: Create key.properties file
run: |
echo "storePassword=$SIGNING_STORE_PASSWORD" > /home/runner/work/Timukas/Timukas/android/key.properties
echo "keyPassword=$SIGNING_KEY_PASSWORD" >> /home/runner/work/Timukas/Timukas/android/key.properties
echo "keyAlias=$SIGNING_KEY_ALIAS" >> /home/runner/work/Timukas/Timukas/android/key.properties
echo "storeFile=keystore/android_keystore.jks" >> /home/runner/work/Timukas/Timukas/android/key.properties
- name: Build APK
run: flutter build apk --split-per-abi --release --build-number ${{ github.event.inputs.build_number }} --build-name ${{ github.event.inputs.build_name }}
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Build APP BUNDLE
run: flutter build appbundle --build-number ${{ github.event.inputs.build_number }} --build-name ${{ github.event.inputs.build_name }}
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Create Release
uses: ncipollo/release-action@v1.10.0
with:
artifacts: "build/app/outputs/apk/release/*.apk, build/app/outputs/bundle/release/*.aab"
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
with:
name: release-apk
path: build/app/outputs/apk/