-
Notifications
You must be signed in to change notification settings - Fork 19
69 lines (56 loc) · 1.69 KB
/
build-publish.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: build & publish
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [debug, release]
include:
- build_type: debug
build_param: assembleDebug
target_path: ./mobile/build/outputs/apk/debug/ssrdroid-debug.apk
- build_type: release
build_param: assembleRelease
target_path: ./mobile/build/outputs/apk/release/ssrdroid-release.apk
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Check out submodules
run: git submodule update --init --recursive
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Rust targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Set up Android NDK
run: sdkmanager --install "ndk;25.1.8937393"
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
run: |
echo "==== Build type: ${{ matrix.build_type }} ===="
./gradlew ${{ matrix.build_param }}
- name: Publish Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ matrix.target_path }}