-
Notifications
You must be signed in to change notification settings - Fork 71
142 lines (142 loc) · 4.58 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
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
131
132
133
134
135
136
137
138
139
140
141
142
name: App Dev Builds
on:
push:
branches: ["nt/gh-actions"]
jobs:
ios-build:
name: iOS Dev Build
runs-on: macos-latest
environment: Android Dev
steps:
- name: Show host machine infomation
run: uname -a
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: nt/gh-actions
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0.0"
- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: 1.15.2
- name: Create Google Services PLIST File
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_PLIST }}
run: echo $GOOGLE_PLIST | base64 --decode > ./ios/GoogleService-Info.plist
# - name: Cache cocoapods
# uses: actions/cache@v3
# with:
# path: /ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
- name: Install npm dependency
run: yarn install
- name: Build iOS JS Bundle
run: |
yarn run package-ios
- name: Install bundler
run: |
cd ios
gem install bundler
- name: Install gem plugins
run: |
cd ios
bundle install
- name: Run fastlane
run: |
cd ios
bundle exec fastlane build_testflight
android-build:
name: Android Dev Build
runs-on: macos-latest
environment: Android Dev
steps:
- name: Show host machine infomation
run: uname -a
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: nt/gh-actions
- name: Create .env file
run: |
echo "ACTIVITY_WEBSOCKET_URL=${{ vars.ACTIVITY_WEBSOCKET_URL }}" >> .env
echo "BUGSNAG_API_KEY=${{ secrets.BUGSNAG_API_KEY }}" >> .env
echo "DEFAULT_PIN=${{ secrets.DEFAULT_PIN }}" >> .env
echo "ECENCY_BACKEND_API=${{ vars.ECENCY_BACKEND_API }}" >> .env
echo "NEW_IMAGE_API=${{ vars.NEW_IMAGE_API }}" >> .env
echo "PIN_KEY=${{ secrets.PIN_KEY }}" >> .env
echo "SERVER_LIST_API=${{ vars.SERVER_LIST_API }}" >> .env
echo "USER_AGENT=${{ vars.USER_AGENT }}" >> .env
echo "PLAUSIBLE_API_KEY=${{ secrets.PLAUSIBLE_API_KEY }}" >> .env
- name: Install npm dependency
run: yarn install
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 11479570
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Create Google Services JSON File
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_JSON }}
run: echo $GOOGLE_JSON | base64 --decode > ./android/app/google-services.json
- name: Bundle Android
run: yarn run bundle:android
- name: Execute Gradle build
run: |
cd android
./gradlew assembleDebug
# - name: Execute Gradle build
# run: |
# cd android
# ./gradlew assembleRelease
- name: Cache generated APK
uses: actions/cache@v3
with:
path: app/build/outputs/apk/
key: apk-${{ runner.os }}-${{ github.sha }}
restore-keys: |
apk-${{ runner.os }}-
- name: Upload application
uses: actions/upload-artifact@v4
with:
name: app
path: ./android/app/build/outputs/apk/debug/app-debug.apk
# - name: Build Android JS Bundle
# run: |
# yarn run package-android
# - name: Delete Android build duplicate assets resource
# run: yarn run delete-pics
# - name: Install bundler
# run: |
# cd android
# gem install bundler
# - name: Install gem plugins
# run: |
# cd android
# bundle install
# - name: Run fastlane
# run: |
# cd android
# bundle exec fastlane build_qa