-
Notifications
You must be signed in to change notification settings - Fork 24
88 lines (79 loc) · 3.02 KB
/
firebase-app-distribution.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
name: '🔥 Firebase App Distribution'
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
# To be removed after tests
pull_request:
branches: ["main"]
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/firebase-service-account.json
jobs:
validation:
runs-on: ubuntu-latest
if: github.repository == 'adevinta/spark-android'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: ./.github/actions/setup-gradle-properties
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1.1.0
- uses: actionsdesk/lfs-warning@e5f9a4c21f4bee104db7c0f23954dde59e5df909 # v3.2
- uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true
- run: ./gradlew dependencyGuard --quiet
- run: ./gradlew spotlessCheck :build-logic:spotlessCheck
build-publish:
if: github.repository == 'adevinta/spark-android'
needs: validation
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: ./.github/actions/setup-gradle-properties
- run: |
echo "$KEYSTORE_BASE64" | base64 --decode > "$KEYSTORE_FILE"
echo storeFile="$KEYSTORE_FILE" >> keystore.properties
echo storePassword="$KEYSTORE_PASSWORD" >> keystore.properties
echo keyAlias="$KEYSTORE_KEY_ALIAS" >> keystore.properties
echo keyPassword="$KEYSTORE_KEY_PASSWORD" >> keystore.properties
env:
KEYSTORE_FILE: ${{ github.workspace }}/keystore.jks
KEYSTORE_BASE64: ${{ secrets.KEYSTORE }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_ALIAS_PASSWORD }}
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm install -g [email protected]
- run: echo "$FIREBASE_SERVICE_ACCOUNT" > "firebase-service-account.json"
env:
FIREBASE_SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
- name: '🐘 Setup Gradle'
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true
- name: '👷 Build'
run: ./gradlew :catalog:assembleRelease
- name: '🔥 Publish'
run: >-
firebase appdistribution:distribute
catalog/build/outputs/apk/release/catalog-release.apk
--app "1:559109812471:android:7aaf1a8ba28904f5f923f2"
--groups "all"
- name: '♻️ Cleanup'
if: ${{ success() || failure() }}
continue-on-error: true
run: |
rm keystore.jks
rm firebase-service-account.json