-
Notifications
You must be signed in to change notification settings - Fork 4
114 lines (102 loc) · 4.05 KB
/
android_alpha.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
name: Build and deploy Android alpha
on:
push:
tags:
- 'android-alpha-*'
branches:
- 'ci/android-alpha-*'
- ci/*
workflow_call:
secrets:
RABBY_MOBILE_ANDROID_KEY_STORE:
required: true
RABBY_MOBILE_ANDROID_KEY_PASSWORD:
required: true
RABBY_MOBILE_ANDROID_KEY_ALIAS:
required: true
RABBY_MOBILE_KR_PWD:
required: true
# defaults:
# run:
# shell: bash -ieo pipefail {0}
env:
BUILD_TARGET_PLATFORM: android
jobs:
alpha-build:
name: android-alpha-build
runs-on:
- self-hosted
- mobile
- macOS
steps:
- uses: actions/checkout@v3
- name: Get Actions Variables
id: actionvars
shell: bash
run: |
echo "{trigger_date}={$(date +'%Y%m%d%H%M%S')}" >> $GITHUB_OUTPUT
flatten_refname=${GITHUB_REF_NAME//\//'_'}
flatten_refname=${GIT_BRANCH//\./'_'}
echo "{flatten_refname}=${flatten_refname}" >> $GITHUB_OUTPUT
# - name: Setup Nodejs and Yarn
# uses: actions/setup-node@v3
# with:
# node-version: 18
# - name: Setup Ruby & Fastlane
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: '2.7'
# bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Setup & Install dependencies
run: |
echo "flatten_refname is $flatten_refname";
echo "trigger_date is $trigger_date";
yarn --version;
# yarn setup && yarn postinstall;
yarn install;
cd apps/mobile;
ls -la ./;
bundle install;
env:
flatten_refname: ${{ steps.actionvars.outputs.flatten_refname }}
trigger_date: ${{ steps.actionvars.outputs.trigger_date }}
# - name: Prepare JSBundle for sourcemap
# run: |
# cd apps/mobile;
# SENTRY_BUNDLE_STAGE=bundle bash ./android/bundle_sourcemap.sh
- name: Build app
env:
RABBY_MOBILE_BUILD_BUCKET: ${{ secrets.RABBY_MOBILE_BUILD_BUCKET }}
RABBY_MOBILE_KR_PWD: ${{ secrets.RABBY_DESKTOP_KR_PWD }}
RABBY_MOBILE_ANDROID_KEY_STORE: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_STORE }}
RABBY_MOBILE_ANDROID_KEY_PASSWORD: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_PASSWORD }}
RABBY_MOBILE_ANDROID_KEY_ALIAS: ${{ secrets.RABBY_MOBILE_ANDROID_KEY_ALIAS }}
RABBY_MOBILE_SENTRY_AUTH_TOKEN: ${{ secrets.RABBY_MOBILE_SENTRY_AUTH_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.RABBY_MOBILE_SENTRY_AUTH_TOKEN }}
LARK_CHAT_URL: ${{ secrets.LARK_CHAT_URL }}
LARK_CHAT_SECRET: ${{ secrets.LARK_CHAT_SECRET }}
# see more details on https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
GIT_ACTIONS_JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GIT_COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
GIT_REF_NAME: ${{ github.ref_name }}
GIT_REF_URL: ${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}
GITHUB_REF: ${{ github.ref }}
run: |
cd apps/mobile;
bundle exec fastlane android alpha;
# - name: Upload app to aws bucket
# run: aws s3 cp ./android/app/build/outputs/apk/release/app-release.apk s3://${RABBY_MOBILE_BUILD_BUCKET}/downloads/debank-app/${APK_NAME}.apk --acl public-read
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rabbymobile-${{ steps.actionvars.outputs.flatten_refname }}-${{ steps.actionvars.outputs.trigger_date }}
path: |
./apps/mobile/android/app/build/outputs/apk/release/app-release.apk
retention-days: 90