-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.96 KB
/
release-android.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
name: release-android
on:
workflow_run:
workflows:
- daily-build
types:
- completed
workflow_dispatch:
jobs:
release-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
registry-url: 'https://npm.pkg.github.com'
always-auth: true
scope: '@onekeyhq'
- name: Setup keys secret
run: |
echo ${{ secrets.AUTO_SUBMIT_GOOGLE_PLAY_KEY }} | base64 -d > packages/app/pc-api-8644398719570171123-0-dcae07e2afab.json
rm -rf packages/app/android/app/google-services.json
echo ${{ secrets.GOOGLE_SERVICE_ANDROID }} | base64 -d > packages/app/android/app/google-services.json
- name: Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: 5.x
eas-version: 0.53.x
token: ${{ secrets.EXPO_TOKEN }}
- name: Setup ENV BUILD_NUMBER to 1
if: ${{ !github.event.workflow_run }}
run: |
# Generate build number ------- start
echo "BUILD_NUMBER=1" >> $GITHUB_ENV
# Generate build number ------- end
- name: Setup ENV BUILD_NUMBER by workflow_run
if: ${{ github.event.workflow_run }}
run: |
echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}"
# Generate build number ------- start
DATE=`date "+%Y%m%d"`
run_number=$(($workflow_run_number % 100))
run_number=$(printf "%02d" $run_number)
build_number="${DATE}${run_number}"
echo '$build_number='$build_number
echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV
# Generate build number ------- end
env:
workflow_run_number: ${{ github.event.workflow_run.run_number}}
- name: Dotenv Action
id: dotenv
uses: falti/[email protected]
with:
path: .env.version
- name: Modify build.gradle
uses: OneKeyHQ/onekey-github-actions/build-gradle-edit@main
with:
versionCode: ${{ env.BUILD_NUMBER }}
versionName: ${{ steps.dotenv.outputs.version }}
android_dir: ./packages/app
- name: Write .env.version
run: |
# pass BUILD_NUMBER as env variable to expo server
echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version
- name: Build on EAS And Submit
if: ${{ github.event.workflow_run }}
run: |
cd packages/app
eas build --profile=production --platform android --non-interactive --no-wait
eas build --profile=production-store --platform android --non-interactive --no-wait --auto-submit
- name: Build on EAS
if: ${{ !github.event.workflow_run }}
run: |
cd packages/app
eas build --profile=production --platform android --non-interactive --no-wait