mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 20:16:06 +08:00
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
name: Pull Request
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
# pull request's head branch was updated
|
|
- synchronize
|
|
|
|
jobs:
|
|
build_pull_request:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-24.04
|
|
- macos-13
|
|
- macos-14
|
|
- windows-2022
|
|
steps:
|
|
- name: Fetch source code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
- name: Setup Android environment
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Install Android NDK
|
|
run: |
|
|
sdkmanager --install "cmake;3.31.6"
|
|
|
|
- name: Install system dependencies (Ubuntu)
|
|
if: ${{ startsWith(matrix.os, 'ubuntu') }}
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install extra-cmake-modules gettext
|
|
|
|
- name: Install system dependencies (macOS)
|
|
if: ${{ startsWith(matrix.os, 'macos') }}
|
|
run: |
|
|
brew install extra-cmake-modules
|
|
|
|
- name: Install system dependencies (Windows)
|
|
if: ${{ startsWith(matrix.os, 'windows') }}
|
|
run: |
|
|
C:/msys64/usr/bin/pacman -Syu --noconfirm
|
|
C:/msys64/usr/bin/pacman -S --noconfirm mingw-w64-ucrt-x86_64-gettext mingw-w64-ucrt-x86_64-extra-cmake-modules
|
|
Add-Content $env:GITHUB_PATH "C:/msys64/ucrt64/bin"
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Build Release APK
|
|
run: |
|
|
./gradlew :app:assembleRelease
|
|
./gradlew :assembleReleasePlugins
|
|
|
|
- name: Upload app
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-${{ matrix.os }}
|
|
path: app/build/outputs/apk/release/
|
|
|
|
- name: Pack plugins
|
|
shell: bash
|
|
run: |
|
|
mkdir plugins-to-upload
|
|
for i in $(ls plugin)
|
|
do
|
|
if [ -d "plugin/${i}" ]
|
|
then
|
|
mv "plugin/${i}/build/outputs/apk/release" "plugins-to-upload/${i}"
|
|
fi
|
|
done
|
|
|
|
- name: Upload plugins
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: plugins-${{ matrix.os }}
|
|
path: plugins-to-upload
|