-
Notifications
You must be signed in to change notification settings - Fork 54
99 lines (95 loc) · 2.89 KB
/
assemble_android_debug.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
# 工作流名称
name: Assemble Android Debug
# 触发工作流程的事件
on:
push:
tags: [ v*, r*, a* ]
pull_request:
branches: [ master ]
workflow_dispatch:
# 工作流环境变量
env:
# 应用的application_id
APP_ID: ${{secrets.APP_ID}}
# 应用名称
APP_NAME: Taro
# 打包类型
BUILD_TYPE: debug
# 版本名称
VERSION_NAME: 1.11.0
# 版本号
VERSION_CODE: 111000
# 密钥库文件
KEYSTORE_FILE: debug.keystore
# 密钥库口令
KEYSTORE_PASSWORD: ${{secrets.DEBUG_KEYSTORE_PASSWORD}}
# 密钥库别名
KEYSTORE_KEY_ALIAS: android
# 密钥库别名口令
KEYSTORE_KEY_PASSWORD: ${{secrets.DEBUG_KEYSTORE_PASSWORD}}
# 工作流作业
jobs:
assemble:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Cache node_modules Folder
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node_modules
restore-keys: ${{ runner.os }}-node_modules
- 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
env:
cache-name: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: |
yarn
- name: Build Taro React Native Bundle
run: |
yarn build:rn --platform android
- name: Cache Gradle
uses: actions/cache@v2
env:
cache-name: gradle-cache
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
restore-keys: |
${{ runner.os }}-gradle
- name: Assemble Android ${{ env.BUILD_TYPE }}
run: |
sudo apt install -y ruby-bundler
cd android
bundle update
bundle exec fastlane assemble
env:
KEYSTORE_FILE: ${{ github.workspace }}/android/app/${{ env.KEYSTORE_FILE }}
- name: Upload Android Products
uses: actions/upload-artifact@v4
with:
name: app-${{ env.BUILD_TYPE }}
path: ${{ github.workspace }}/android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
- name: Upload release assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: ${{ contains(github.ref, 'beta') }}
files: |
android/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}