-
Notifications
You must be signed in to change notification settings - Fork 22
176 lines (153 loc) · 7.2 KB
/
tencent_official.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
165
166
167
168
169
170
171
172
173
174
175
176
name: Android Release CI
on:
release:
types: [published]
env:
IOT_SONATYPE_USERNAME: ${{ secrets.IOT_SONATYPE_USERNAME }}
IOT_SONATYPE_PASSWORD: ${{ secrets.IOT_SONATYPE_PASSWORD }}
IOT_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.IOT_RELEASE_KEYSTORE_PASSWORD }}
GPG_DECRYPT_PASSPHRASE: ${{ secrets.GPG_DECRYPT_PASSPHRASE }}
IOT_GPG_KEYNAME: ${{ secrets.IOT_GPG_KEYNAME }}
IOT_GPG_PASSPHRASE: ${{ secrets.IOT_GPG_PASSPHRASE }}
IOT_GITHUB_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }}
IOT_WECOM_CID_ROBOT_KEY: ${{ secrets.IOT_WECOM_CID_ROBOT_KEY }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: |
rm -rf app-config.json app/google-services.json
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/tencent_official_keystore.jks.asc > tencent_official_keystore.jks
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/app-config.json.asc > app-config.json
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/app/google-services.json.asc > app/google-services.json
gpg -d --passphrase "$GPG_DECRYPT_PASSPHRASE" --batch --quiet .github/sdk/secring.gpg.asc > secring.gpg
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# - name: Setup cmake
# uses: jwlawson/[email protected]
# with:
# cmake-version: '3.10.2'
- name: Use cmake
run: |
cmake --version
- name: Common-->install fir
run: sudo gem install fir-cli
- name: Common-->Fix App Version
run: |
rb=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
rtt=$(git describe --tags `git rev-list --tags --max-count=1`)
rt=${rtt#*v}
echo "curr_tag=$rtt" >> $GITHUB_ENV
rc=$(git rev-parse --short HEAD)
sed -i 's#def versionAppName.*#def versionAppName = \"'$rt'\"#g' config.gradle
sed -i 's#def sdkVersion.*#def sdkVersion = \"'$rt'\"#g' config.gradle
sed -i "s#xxx#$rb+git.$rc#g" config.gradle
sed -i '/snapshots/, +d' build.gradle
- name: Common-->Update Values of Signing
run: |
export KEY_ID_OF_SIGN=$IOT_GPG_KEYNAME
export PASSWORD_OF_SIGN=$IOT_GPG_PASSPHRASE
sh .github/scripts/updateValuesForSign.sh
- name: Link-->Update Link App VersionCode
if: ${{!contains(env.curr_tag, 'video')}}
run: |
sh .github/scripts/updateVersionCode.sh
- name: Link-->Adapt build.gradle from debug to release
if: ${{!contains(env.curr_tag, 'video')}}
run: |
sed -i 's#opensource_keystore#tencent_official_keystore#g' app/build.gradle
sed -i '/opensource {/, +4d' app/build.gradle
sed -i 's#//-##g' app/build.gradle
sed -i "s#'111222'#System.getenv(\"IOT_RELEASE_KEYSTORE_PASSWORD\")#g" app/build.gradle
sed -i 's#-SNAPSHOT##g' sdk/explorer-link-android/build.gradle
sed -i 's#-SNAPSHOT##g' sdk/explorer-link-rtc/build.gradle
- name: Video-->Update Video SDK Version
if: ${{contains(env.curr_tag, 'video')}}
run: |
export VIDEO_TAG=${{env.curr_tag}}
bash .github/scripts/updateVideoSDKVersion.sh
- name: Video-->Build Video with Gradle
if: ${{contains(env.curr_tag, 'video')}}
run: |
./gradlew :sdk:video-link-android:build :sdkdemo:build
- name: Video-->Publish aar to Maven
if: ${{contains(env.curr_tag, 'video')}}
run: ./gradlew :sdk:video-link-android:publish
- name: Link-->Build Link with Gradle
if: ${{!contains(env.curr_tag, 'video')}}
run: ./gradlew :sdk:explorer-link-android:build :sdk:explorer-link-rtc:build :app:build
- name: Link-->Package apk and aar with Gradle
if: ${{!contains(env.curr_tag, 'video')}}
run: ./gradlew assembleTencentOfficial
- name: Link-->Publish aar to Maven
if: ${{!contains(env.curr_tag, 'video')}}
run: ./gradlew :sdk:explorer-link-android:publish :sdk:explorer-link-rtc:publish
- name: Link-->Update iot-version-android.txt in iot-version repo
if: ${{!contains(env.curr_tag, 'video')}}
run: sh .github/scripts/updateVersionInIotVersionRepo.sh
- name: Link-->Encrypt Link Apk
if: ${{!contains(env.curr_tag, 'video')}}
run: |
gpg --batch --passphrase "$GPG_DECRYPT_PASSPHRASE" -c app/build/outputs/apk/tencentOfficial/debug/*.apk
gpg --batch --passphrase "$GPG_DECRYPT_PASSPHRASE" -c app/build/outputs/apk/tencentOfficial/release/*.apk
- name: Link--Archive the encrypted link app
if: ${{!contains(env.curr_tag, 'video')}}
uses: actions/upload-artifact@v2
with:
path: app/build/outputs/apk/tencentOfficial/release/*.apk.gpg
- name: Link-->Rename Release Link APK
if: ${{!contains(env.curr_tag, 'video')}}
run: |
APK_PATH=$(ls app/build/outputs/apk/tencentOfficial/release/*.apk.gpg)
cp $APK_PATH iot-link-android.apk.gpg
- name: Link-->Upload Release apk to Asset
if: ${{!contains(env.curr_tag, 'video')}}
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: iot-link-android.apk.gpg
asset_name: iot-link-android.apk.gpg
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Video-->Encrypt SDK Demo
if: ${{contains(env.curr_tag, 'video')}}
run: |
gpg --batch --passphrase "$GPG_DECRYPT_PASSPHRASE" -c sdkdemo/build/outputs/apk/release/*.apk
- name: Video-->Rename Release SDK Demo APK
if: ${{contains(env.curr_tag, 'video')}}
run: |
SDKDEMO_PATH=$(ls sdkdemo/build/outputs/apk/release/*-release.apk.gpg)
cp $SDKDEMO_PATH sdkdemo-release.apk.gpg
- name: Video-->Upload SDK Demo to Asset
if: ${{contains(env.curr_tag, 'video')}}
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: sdkdemo-release.apk.gpg
asset_name: sdkdemo-release.apk.gpg
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Video-->Deploy SDKDemo to fir
if: ${{contains(env.curr_tag, 'video')}}
run: |
demoApk=$(ls sdkdemo/build/outputs/apk/release/sdkdemo-release.apk)
rc=$(git rev-parse --short HEAD)
rl=$(git log --pretty=format:"%s" $rc -1)
fir publish $demoApk -T $IOT_FIRIM_API_TOKEN -c "$rl" --oversea_turbo --force_pin_history -V
env:
IOT_FIRIM_API_TOKEN: ${{ secrets.IOT_FIRIM_API_TOKEN }}
- name: Report success result to wecom
if: ${{ success() }}
run: |
echo success!!!
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} success
- name: Report fail result to wecom
if: ${{ failure() }}
run: |
echo fail!!!
bash .github/scripts/send_result_to_wecom.sh ${{ github.event.repository.name }} fail