-
Notifications
You must be signed in to change notification settings - Fork 18
164 lines (160 loc) · 7.21 KB
/
feature-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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Workflow for develop branch changes.
# When a pull request is being merged in develop, this workflows triggers
on:
pull_request:
types:
- closed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
android-lint:
name: "Run ktlint check"
runs-on: ubuntu-latest
steps:
- name: "Check if pull request was merged"
run: |
if [ "${{ github.event.pull_request.merged }}" != "true" ]; then
echo "Pull request was not merged. Skipping the workflow."
exit 0
fi
- uses: actions/checkout@v3
with:
ref: develop
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: Run ktlint
run: ./gradlew ktlint -PautoCorrect=0
android-unit-tests:
name: "Run unit tests"
needs:
- android-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: develop
- name: "Initializing firebase configs"
uses: ./.github/actions/setup-google-services
with:
google-services-content: ${{ secrets.GOOGLE_SERVICE_JSON_SECRET }}
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: Run unit tests
run: ./gradlew testDebugUnitTest
android-build-artifacts:
name: "Run build feature artifacts"
needs:
- android-lint
- android-unit-tests
runs-on: ubuntu-latest
steps:
- name: "Checkout to the current commit hash"
uses: actions/checkout@v3
with:
ref: develop
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: "Initializing firebase configs"
uses: ./.github/actions/setup-google-services
with:
google-services-content: ${{ secrets.GOOGLE_SERVICE_JSON_SECRET }}
- name: "Initialize project keys"
uses: ./.github/actions/setup-project
with:
amplitude-key-debug: ${{ secrets.AMPLITUDE_KEY_DEBUG }}
amplitude-key-release: ${{ secrets.AMPLITUDE_KEY_RELEASE }}
torus-verifier-debug: ${{ secrets.TORUS_VERIFIER_DEBUG }}
torus-verifier-feature: ${{ secrets.TORUS_VERIFIER_FEATURE }}
torus-sub-verifier-feature: ${{ secrets.TORUS_SUB_VERIFIER_FEATURE }}
torus-verifier-release: ${{ secrets.TORUS_VERIFIER_RELEASE }}
rpc-pool-key: ${{ secrets.RPC_POOL_API_KEY }}
moonpay-key: ${{ secrets.MOONPAY_KEY }}
moonpay-sandbox-key: ${{ secrets.MOONPAY_SANDBOX_KEY }}
intercom-key: ${{ secrets.INTERCOM_API_KEY }}
intercom-app-id: ${{ secrets.INTERCOM_APP_ID }}
apps-flyer-key: ${{ secrets.APPS_FLYER_KEY }}
compare-key: ${{ secrets.COMPARE_PUBLIC_KEY }}
sentry-auth-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
sentry-auth-dsn: ${{ secrets.SENTRY_AUTH_DSN }}
lokalise-key: ${{ secrets.LOKALISE_KEY }}
lokalise-app-id: ${{ secrets.LOKALISE_APP_ID }}
svl-memo-send: ${{ secrets.SVL_MEMO_SEND }}
svl-memo-claim: ${{ secrets.SVL_MEMO_CLAIM }}
salt-prefix: ${{ secrets.SALT_PREFIX }}
- name: "Generate changelog"
uses: ./.github/actions/setup-changelog
with:
current-ref-name: "develop"
- name: "Send start deploy message to slack"
run: bash bash_scripts/slack_start_message.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }}
- name: "Generate a unique version build"
uses: ./.github/actions/setup-version-build
- name: "Build feature APK"
run: ./gradlew assembleFeature
# - name: "Upload APK to Firebase (Feature)"
# env:
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
# run: ./gradlew appDistributionUploadFeature
- name: "Upload APK to Slack (Feature)"
uses: ./.github/actions/setup-slack
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
build-type: "feature"
artifact-type: "apk"
- name: "Upload changelog, and Jira ticket to slack channel"
run: bash bash_scripts/slack_upload_changelog.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }} CHANGELOG.txt
- name: "Send finish deploy message to slack"
run: |
value=`cat timestamp.txt`
bash bash_scripts/slack_finish_message.sh ${{ secrets.SLACK_BOT_TOKEN }} ${{ secrets.SLACK_CHANNEL_ID }} $value
- name: "Get last commit hash and save into LastCommit.kt"
run: ./gradlew setLastCommitHash -Phash=$(git rev-parse HEAD)
- name: "Commit and Push changes"
uses: ./.github/actions/setup-commit
with:
github-author-email: ${{ vars.GIT_AUTHOR_EMAIL }}