2020-12-25 15:01:02 -08:00
|
|
|
name: Magisk Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2020-12-28 16:38:25 -08:00
|
|
|
paths:
|
|
|
|
- 'app/**'
|
|
|
|
- 'native/**'
|
|
|
|
- 'stub/**'
|
|
|
|
- 'buildSrc/**'
|
|
|
|
- 'build.py'
|
|
|
|
- 'gradle.properties'
|
2020-12-25 15:01:02 -08:00
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest, windows-latest, macOS-latest ]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: '11'
|
|
|
|
|
|
|
|
- name: Set up Python 3
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
|
2021-05-05 12:32:25 +08:00
|
|
|
- name: Set up GitHub env
|
2020-12-25 15:54:47 -08:00
|
|
|
run: |
|
|
|
|
ndk_ver=$(sed -n 's/^magisk.fullNdkVersion=//p' gradle.properties)
|
|
|
|
echo ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT >> $GITHUB_ENV
|
|
|
|
echo MAGISK_NDK_VERSION=$ndk_ver >> $GITHUB_ENV
|
2021-05-05 12:32:25 +08:00
|
|
|
shell: bash
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
- name: Cache Gradle
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle-
|
|
|
|
|
|
|
|
- name: Cache NDK
|
|
|
|
id: ndk-cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ${{ env.ANDROID_SDK_ROOT }}/ndk/magisk
|
2020-12-25 15:54:47 -08:00
|
|
|
key: ${{ runner.os }}-ndk-${{ env.MAGISK_NDK_VERSION }}
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
- name: Set up NDK
|
|
|
|
if: steps.ndk-cache.outputs.cache-hit != 'true'
|
2020-12-25 15:54:47 -08:00
|
|
|
run: python build.py ndk
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
- name: Build release
|
2020-12-25 15:54:47 -08:00
|
|
|
run: python build.py -vr all
|
2020-12-25 15:01:02 -08:00
|
|
|
|
2021-04-06 20:25:46 +08:00
|
|
|
- name: Refresh flag
|
|
|
|
run: touch gradle.properties
|
|
|
|
shell: bash
|
|
|
|
|
2020-12-25 15:01:02 -08:00
|
|
|
- name: Build debug
|
2020-12-25 15:54:47 -08:00
|
|
|
run: python build.py -v all
|
2020-12-25 15:01:02 -08:00
|
|
|
|
2021-05-05 12:32:25 +08:00
|
|
|
- name: Stop gradle daemon
|
|
|
|
run: ./gradlew --stop
|
|
|
|
|
2020-12-25 15:01:02 -08:00
|
|
|
# Only upload artifacts built on Linux
|
|
|
|
- name: Upload build artifact
|
2020-12-27 04:02:20 -08:00
|
|
|
if: runner.os == 'Linux'
|
2020-12-25 15:01:02 -08:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-12-25 15:54:47 -08:00
|
|
|
name: ${{ github.sha }}
|
2020-12-25 15:01:02 -08:00
|
|
|
path: out
|