Skip to content

Commit

Permalink
CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Nov 18, 2024
1 parent f9cdd2e commit 69d3795
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}

0 comments on commit 69d3795

Please sign in to comment.