-
Notifications
You must be signed in to change notification settings - Fork 8
125 lines (102 loc) · 4.29 KB
/
main.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
name: CI
on:
pull_request:
branches:
- develop
- alpha/*
workflow_dispatch:
jobs:
on_start_build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install python dependency
run: pip install beautifulsoup4
- name: Install python requests
run: pip install requests
- name: Send lark message
run: python ./.github/scripts/send_lark_message.py start "$LARK_BOT_APP_ID" "$LARK_BOT_APP_SECRET" "$GITHUB_RUN_ID" "$TITLE" "$BODY"
env:
LARK_BOT_APP_ID: ${{secrets.LARK_BOT_APP_ID}}
LARK_BOT_APP_SECRET: ${{secrets.LARK_BOT_APP_SECRET}}
TITLE: ${{ github.event.pull_request.title }}
BODY: ${{ github.event.pull_request.body}}
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install python requests
run: pip install requests
- name: create secret file
run: python ./.github/scripts/create_secret.py "$BUGLY_APP_ID" "$SOPHIX_APP_ID" "$SOPHIX_APP_SECRET" "$SOPHIX_RSA" "$UM_APP_KEY" "$UM_PUSH_SECRET" "$UM_SHARE_SINA_APP_KEY" "$UM_SHARE_SINA_APP_SECRET" "$UM_SHARE_QQ_ZONE_APP_ID" "$UM_SHARE_QQ_ZONE_APP_SECRET" "$amap_apikey" "$RELEASE_KEY_ALIAS" "$RELEASE_KEY_PASSWORD" "$RELEASE_STORE_PASSWORD" "$KEY_CYXBS_URL"
env:
BUGLY_APP_ID: ${{secrets.BUGLY_APP_ID}}
SOPHIX_APP_ID: ${{secrets.SOPHIX_APP_ID }}
SOPHIX_APP_SECRET: ${{secrets.SOPHIX_APP_SECRET}}
SOPHIX_RSA: ${{secrets.SOPHIX_RSA}}
UM_APP_KEY: ${{secrets.UM_APP_KEY}}
UM_PUSH_SECRET: ${{secrets.UM_PUSH_SECRET}}
UM_SHARE_SINA_APP_KEY: ${{secrets.UM_SHARE_SINA_APP_KEY}}
UM_SHARE_SINA_APP_SECRET: ${{secrets.UM_SHARE_SINA_APP_SECRET}}
UM_SHARE_QQ_ZONE_APP_ID: ${{secrets.UM_SHARE_QQ_ZONE_APP_ID}}
UM_SHARE_QQ_ZONE_APP_SECRET: ${{secrets.UM_SHARE_QQ_ZONE_APP_SECRET}}
amap_apikey: ${{secrets.amap_apikey}}
RELEASE_KEY_ALIAS: ${{secrets.RELEASE_KEY_ALIAS}}
RELEASE_KEY_PASSWORD: ${{secrets.RELEASE_KEY_PASSWORD}}
RELEASE_STORE_PASSWORD: ${{secrets.RELEASE_STORE_PASSWORD}}
KEY_CYXBS_URL: ${{secrets.KEY_CYXBS_URL}}
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: CyxbsMobile-test.apk
path: cyxbs-applications/test/build/outputs/apk/release/test-release-unsigned.apk
retention-days: 15
send_message:
if: always()
runs-on: macos-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install python dependence
run: pip install beautifulsoup4
- name: Send lark message
run: python ./.github/scripts/send_lark_message.py "${{needs.build.result}}" "$LARK_BOT_APP_ID" "$LARK_BOT_APP_SECRET" "$GITHUB_RUN_ID" "$TITLE" "$BODY"
env:
LARK_BOT_APP_ID: ${{secrets.LARK_BOT_APP_ID}}
LARK_BOT_APP_SECRET: ${{secrets.LARK_BOT_APP_SECRET}}
TITLE: ${{ github.event.pull_request.title }}
BODY: ${{ github.event.pull_request.body }}