-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (65 loc) · 2.48 KB
/
build-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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Generated Android Build
env:
# The name of the Play Store
playstore_name: Radio Crestin
on:
push:
branches:
- 'release/**'
release:
types: [ published ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Install 1Password Cli
run: |
curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip
unzip op.zip
sudo mv op /usr/local/bin
rm op.zip
- name: Get 1Password Secrets
run: |
op read op://radio-crestin-app/key.properties/notesPlain -o android/key.properties
op read op://radio-crestin-app/local.properties/notesPlain -o android/local.properties
op read op://radio-crestin-app/google-services.json/notesPlain -o android/app/google-services.json
op read op://radio-crestin-app/radio-crestin-app-keystore.jks/radio-crestin-app-keystore.jks -o android/app/radio-crestin-app-keystore.jks
working-directory: ./
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.3'
channel: 'stable'
architecture: x64
- name: Get dependencies
run: flutter pub get
# - name: Test the application
# run: flutter test
- name: Build android apk
run: flutter build apk
- name: Build android AppBundle
run: flutter build appbundle
- name: Upload APK Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: app-release.apk
path: build/app/outputs/flutter-apk/app-release.apk
- name: Upload AAB (App Bundle) Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: app-release.aab
path: build/app/outputs/bundle/release/app-release.aab