-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (70 loc) · 2.14 KB
/
build.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: Build dev artefacts
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
required: false
type: string
pull_request:
types: ["labeled"]
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'build')
strategy:
matrix:
include:
- target: 'apk --debug --flavor=dev'
name: 'APK'
path: build/app/outputs/flutter-apk/app-dev-debug.apk
- target: 'web --dart-define=flavor=dev'
name: 'Web'
path: build/web/
steps:
- name: Determine ref
id: get-ref
run: |
input_ref=${{ inputs.ref }}
github_ref=${{ github.sha }}
ref=${input_ref:-$github_ref}
echo ref=$ref >> $GITHUB_OUTPUT
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
ref: ${{ steps.get-ref.outputs.ref }}
- name: Setup Java
if: matrix.name == 'APK'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17.x'
cache: 'gradle'
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.2'
cache: true
- name: Cleanup 🧹
run: flutter clean
- name: Get Packages
run: flutter pub get
- name: Configure Dev env
run: echo DEV_HOST=$DEV_HOST >> .env
env:
DEV_HOST: ${{ vars.DEV_HOST }}
- name: Add Firebase configuration for Dev
run: |
echo $GOOGLE_SERVICES_DEV_JSON_BASE64 | base64 -d > android/app/src/dev/google-services.json
env:
GOOGLE_SERVICES_DEV_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_DEV_JSON_BASE64 }}
- name: Build Dev 🔧
run: flutter build ${{ matrix.target }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: titan-debug-${{ matrix.name }}
path: ${{ matrix.path }}
if-no-files-found: ignore