-
Notifications
You must be signed in to change notification settings - Fork 27
130 lines (110 loc) · 3.98 KB
/
build_and_deploy.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: build dev
on:
release:
types: [published]
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: cimg/android:2022.08.1-ndk
options: --user root
steps:
- name: install git
run: |
sudo apt-get update;
sudo apt-get -y install git;
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
build-root-directory: android
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install yarn
run: npm install -g yarn
- name: Load Cache
uses: actions/setup-node@v3
with:
cache: 'yarn'
- name: Install packages
run: yarn install --frozen-lockfile # install project deps with --frozen-lockfile to make sure we will have the same packages version ( very recommended on running yarn install on ci)
- name: patch notifee rn package
run: |
sed -E -i 's/^.*(fabric|com\.(crashlytics|google\.(firebase|android.gms))).*$//g' ./node_modules/@notifee/react-native/android/build.gradle
- name: Compile lingui.js locales
run: |
sed "s/<TRANSLATION_IO_APIKEY>//" lingui.config.js.example > lingui.config.js;
yarn lingui compile;
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: free disk space
run: |
yarn cache clean
sudo apt clean
df -h
- name: build
run: |
cd android
./gradlew --no-daemon :app:bundleRelease -PnoSign
./gradlew --no-daemon :app:assembleRelease -PnoSign -PuseLegacyPackaging=true
- name: Sign App Apk
if: ${{ github.event_name == 'release'}}
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
alias: ${{ secrets.ANDROID_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
env:
# build tools version is found inside cimg/android related tag pulled layers details inside docker hub. after `...-c SDK_TOOLS_URL=...`
BUILD_TOOLS_VERSION: "33.0.0"
- name: Sign App Bundle
if: ${{ github.event_name == 'release' }}
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
alias: ${{ secrets.ANDROID_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
env:
# build tools version is found inside cimg/android related tag pulled layers details inside docker hub. after `...-c SDK_TOOLS_URL=...`
BUILD_TOOLS_VERSION: "33.0.0"
- name: Release on GitHub
uses: ncipollo/release-action@v1
with:
prerelease: true
omitBody: true
omitBodyDuringUpdate: true
omitName: true
allowUpdates: true
replacesArtifacts: true
updateOnlyUnreleased: true
artifacts: android/app/build/outputs/apk/release/*signed.apk,android/app/build/outputs/bundle/release/*.aab
- name: Push to Play Store
if: ${{ github.event_name == 'release' && !contains(github.ref, '-rc') }}
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.github.meypod.al_azan
releaseFiles: android/app/build/outputs/bundle/release/*.aab
track: internal
status: draft
# changesNotSentForReview: true