-
Notifications
You must be signed in to change notification settings - Fork 3
92 lines (79 loc) · 2.51 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
83
84
85
86
87
88
89
90
91
92
name: Build dev artefacts
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
required: false
type: string
pull_request:
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: macos-latest
strategy:
matrix:
include:
- target: 'apk --debug --flavor=dev'
name: 'APK'
path: build/app/outputs/flutter-apk/app-dev-debug.apk
- target: 'web'
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: '11.x'
cache: 'gradle'
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.19.1'
cache: true
- name: Cleanup 🧹
run: flutter clean
- name: Get Packages
run: flutter pub get
- name: Configure Dev env
run: |
echo THE_MOVIE_DB_API=$THE_MOVIE_DB_API >> .env
echo DEBUG_HOST=$DEBUG_HOST >> .env
echo RELEASE_HOST=$RELEASE_HOST >> .env
env:
THE_MOVIE_DB_API: ${{ secrets.THE_MOVIE_DB_API }}
DEBUG_HOST: ${{ secrets.DEBUG_HOST }}
RELEASE_HOST: ${{ secrets.DEBUG_HOST }}
- name: Add Firebase configuration for Dev
run: |
echo $GOOGLE_SERVICES_DEV_JSON_BASE64 | base64 -D -o android/app/src/dev/google-services.json
env:
GOOGLE_SERVICES_DEV_JSON_BASE64: ${{ secrets.GOOGLE_SERVICES_DEV_JSON_BASE64 }}
- name: Set Dev icons
run: |
rm assets/images/icon.png
mv assets/images/icon_dev.png assets/images/icon.png
rm assets/images/logo.png
mv assets/images/logo_dev.png assets/images/logo.png
- 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