122 lines (103 loc) · 4.09 KB
/
fastlane.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
name: CI-Fastlane
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the fastlane branch
on:
push:
branches: [fastlane]
pull_request:
branches: [fastlane]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Slack Notification Start
uses: act10ns/slack@v1
with:
status: 'START'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: always()
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Check out credentials
uses: actions/checkout@v2
with:
repository: thinhtran3588/fastlane-credentials
token: ${{ secrets.PAT }}
path: 'fastlane-credentials'
- name: Cache npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cache Pods
uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Cache Gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Copy credentials
run: |
\cp fastlane-credentials/android/app/mobile.keystore android/app/mobile.keystore
\cp fastlane-credentials/android/fastlane/googlePlaySecretKey.json android/fastlane/googlePlaySecretKey.json
\cp fastlane-credentials/android/keystore.properties android/keystore.properties
\cp fastlane-credentials/tqt-mobile-starter-kit/production/android/app/google-services.json android/app/google-services.json
\cp fastlane-credentials/tqt-mobile-starter-kit/production/sentry.properties android/sentry.properties
\cp fastlane-credentials/ios/.env.default ios/.env.default
\cp fastlane-credentials/tqt-mobile-starter-kit/production/ios/GoogleService-Info.plist ios/GoogleService-Info.plist
\cp fastlane-credentials/tqt-mobile-starter-kit/production/sentry.properties ios/sentry.properties
\cp fastlane-credentials/tqt-mobile-starter-kit/production/.env .env
- name: Restore package
run: |
yarn
- name: Validate source code
run: yarn validate
- name: Update build number
run: |
yarn update-build ${GITHUB_RUN_NUMBER}
- name: Build & publish to Testflight
run: |
yarn ios-testflight
- name: Build & publish to Alpha channel
run: |
yarn android-alpha
- name: Build APK
run: |
yarn android-build-apk
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: app-release
path: android/app/build/outputs/apk/release/app-release.apk
- name: Slack Notification Finish
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
if: always()