-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (59 loc) · 1.96 KB
/
ci.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
name: CI
on:
workflow_dispatch:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
merge_group:
jobs:
build:
runs-on: ubuntu-latest
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_HARDLINK: "true"
CCACHE_BASEDIR: "${{ github.workspace }}"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-depth: 0
- name: Write key
if: ${{ ( github.event_name != 'pull_request' && github.ref == 'refs/heads/master' ) || github.ref_type == 'tag' }}
run: |
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
echo storePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile=$PWD/'key.jks' >> keystore.properties
echo '${{ secrets.KEY_STORE }}' | base64 --decode > key.jks
fi
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build with Gradle
run: |
./gradlew assemble
- name: Upload release
uses: actions/upload-artifact@v3
with:
name: "RoTieba-release-ci"
path: "./app/build/outputs/apk/release/app-release.apk"
- name: Upload release mapping
uses: actions/upload-artifact@v3
with:
name: "release-mappings"
path: "./app/build/outputs/mapping/release/"
- name: Upload debug
uses: actions/upload-artifact@v3
with:
name: "RoTieba-debug-ci"
path: "./app/build/outputs/apk/debug/app-debug.apk"