-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (101 loc) · 3.43 KB
/
action.flutter.build.yaml
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
name: Flutter - Build
on:
workflow_call:
inputs:
flutter_version:
description: 'The Flutter used (ex: 2.5.1)'
required: true
type: string
android_output:
description: 'Android build file type output (apk or abb)'
required: true
type: string
env:
description: 'Environment in which the application will be build'
required: true
type: string
jobs:
Android:
name: 'Android (${{ inputs.android_output }})'
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Decrypt secret configuration'
run: ./.github/scripts/decrypt_secret.sh
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: 'Check secret configuration'
run: ./.github/scripts/check_secrets_decryption.sh
- name: 'Set up JAVA'
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17.x'
- name: 'Setup Flutter'
uses: subosito/[email protected]
with:
flutter-version: ${{ inputs.flutter_version }}
- name: 'Generate build number'
run: |
BUILD_NUMBER=$(date +%s)
BUILD_NAME=$(git describe --abbrev=0 --tags)
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
echo "This build is tagged as $BUILD_NUMBER on $GITHUB_REF"
- name: 'Build Android APK'
if: ${{ inputs.android_output == 'apk' }}
run: flutter build apk --build-number="$BUILD_NUMBER" --split-per-abi
env:
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
BUILD_NAME: ${{ env.BUILD_NAME }}
ENV: ${{ inputs.env }}
- name: 'Save APK'
if: ${{ inputs.android_output == 'apk' }}
uses: actions/upload-artifact@v4
with:
name: 'apk-build'
path: build/app/outputs/apk/release/app-arm64-v8a-release.apk
- name: 'Build Android App Bundle'
if: ${{ inputs.android_output == 'aab' }}
run: flutter build appbundle --build-number="$BUILD_NUMBER" --dart-define=SENTRY_DSN="$SENTRY_DSN" --dart-define=ENV="$ENV"
env:
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
BUILD_NAME: ${{ env.BUILD_NAME }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
ENV: ${{ inputs.env }}
- name: 'Save AAB'
if: ${{ inputs.android_output == 'aab' }}
uses: actions/upload-artifact@v4
with:
name: 'aab-build'
path: build/app/outputs/bundle/release/app-release.aab
build_ios:
name: 'iOS'
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: actions/checkout@v4
- name: 'Decrypt secret configuration'
run: ./.github/scripts/decrypt_secret.sh
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: 'Check secret configuration'
run: ./.github/scripts/check_secrets_decryption.sh
- name: '🥺'
run: echo 'WIP'
build_web:
name: 'WEB'
runs-on: ubuntu-latest
steps:
- name: 'Checkout source code'
uses: actions/checkout@v4
- name: 'Decrypt secret configuration'
run: ./.github/scripts/decrypt_secret.sh
env:
PASSPHRASE: ${{ secrets.PASSPHRASE }}
- name: 'Check secret configuration'
run: ./.github/scripts/check_secrets_decryption.sh
- name: '🥺'
run: echo 'WIP'