-
Notifications
You must be signed in to change notification settings - Fork 36
102 lines (89 loc) · 3.41 KB
/
release-android-base.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
name: release-android-base
on:
workflow_call:
inputs:
name:
description: 'Name of the project'
required: true
type: string
root-path:
description: 'Path of the react-native project'
required: true
type: string
release-type:
description: 'Release type of the project (debug/internal/production)'
default: 'internal'
type: string
output-path:
description: 'Path to get the APK file'
required: true
type: string
secrets:
project-id:
description: 'Reown Cloud ID'
required: true
firebase-app-id:
required: true
gsa-key:
required: true
relay-url:
description: 'Relay URL'
required: false
sentry-dsn:
required: true
sentry-file:
required: true
secrets-file:
required: true
keystore-name:
required: true
keystore:
required: true
google-services-file:
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/ci-setup
with:
root-path: ${{ inputs.root-path }}
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
architecture: x86_64
- name: Create env file
run: touch ${{ inputs.root-path }}/.env.${{ inputs.release-type }} && echo -e "ENV_PROJECT_ID=${{ secrets.project-id }}\nENV_RELAY_URL=${{ secrets.relay-url }}\nENV_SENTRY_DSN=${{ secrets.sentry-dsn }}\nENV_SENTRY_TAG=${{ inputs.release-type }}" >> ${{ inputs.root-path }}/.env.${{ inputs.release-type }}
- name: Add Sentry file
run: touch ${{ inputs.root-path }}/android/sentry.properties && echo "${{ secrets.sentry-file }}" >> ${{ inputs.root-path }}/android/sentry.properties
- name: Add Secrets file
run: touch ${{ inputs.root-path }}/android/secrets.properties && echo "${{ secrets.secrets-file }}" >> ${{ inputs.root-path }}/android/secrets.properties
- name: Add Keystore file
run: echo ${{ secrets.keystore }} | base64 --decode >> ${{ inputs.root-path }}/android/app/${{ secrets.keystore-name }}.keystore
- name: Add Google Services file
env:
google-services-file: ${{ secrets.google-services-file }}
if: ${{ env.google-services-file != '' }}
run: echo ${{ env.google-services-file }} | base64 --decode >> ${{ inputs.root-path }}/android/app/google-services.json
- name: Build APK
run: |
if [ ${{ inputs.release-type }} = 'internal' ]; then
cd ${{ inputs.root-path }} && yarn install && yarn run android:build:internal
else
cd ${{ inputs.root-path }} && yarn install && yarn run android:build
fi
- name: Setup Firebase
uses: w9jds/setup-firebase@main
with:
tools-version: 13.0.1
gcp_sa_key: ${{ secrets.gsa-key }}
- name: Upload APK
env:
APP_ID: ${{ secrets.firebase-app-id }}
run: |
firebase appdistribution:distribute ${{ inputs.output-path }} --app $APP_ID --release-notes "${{ inputs.name }} ${{ inputs.release-type }} release" --groups "flutter-team, javascript-team, kotlin-team, unity, rust-team, swift-team, wc-testers"