forked from CofbroTeam/Doraemon
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.69 KB
/
gradle-release.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
name: CI
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare signing key
run: echo '${{ secrets.SIGNING_KEY }}' | base64 -d > signingkey.jks
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build release binary with Gradle
uses: gradle/gradle-command-action@v2
env:
ALIAS: ${{ secrets.ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
with:
arguments: assembleRelease
- name: Clean up
run: |
rm signingkey.jks
rm -f ${{github.workspace}}/app/build/outputs/apk/release/app-release-unsigned.apk
- name: Upload to GitHub release
uses: ncipollo/release-action@v1
with:
# allowUpdates: true
artifacts: "${{github.workspace}}/app/build/outputs/apk/release/*.apk"
# Upload to COS
- name: Upload to COS
uses: git9527/setup-coscli@v2
with:
region: ${{ secrets.COS_REGION }}
secret-id: ${{ secrets.COS_SECRET_ID }}
secret-key: ${{ secrets.COS_SECRET_KEY }}
bucket: ${{ secrets.COS_BUCKET }}
coscli-version: 'v0.12.0-beta' # Optional, default to 'v0.12.0-beta'. Use 'latest' to get the latest version.
- run: |
coscli sync ${{github.workspace}}/app/build/outputs/apk/release cos://${{ secrets.COS_BUCKET }} --recursive --thread-num 20