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'
|
2021-09-07 22:50:47 -07:00
|
|
|
- '.github/workflows/build.yml'
|
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:
|
2021-09-07 21:03:32 -07:00
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
2021-09-07 22:50:47 -07:00
|
|
|
env:
|
|
|
|
NDK_CCACHE: ${{ github.workspace }}/ccache
|
2021-09-08 16:40:33 +08:00
|
|
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
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-09-07 22:50:47 -07:00
|
|
|
- name: Set up ccache
|
|
|
|
run: bash .github/ccache.sh
|
2020-12-25 15:01:02 -08:00
|
|
|
|
2021-09-08 01:16:26 -07:00
|
|
|
- name: Cache Gradle dependencies
|
2020-12-25 15:01:02 -08:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
2021-09-08 01:16:26 -07:00
|
|
|
!~/.gradle/caches/build-cache-*
|
2020-12-25 15:01:02 -08:00
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle-
|
|
|
|
|
2021-09-08 01:16:26 -07:00
|
|
|
- name: Cache build cache
|
2021-09-07 22:50:47 -07:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2021-09-08 01:16:26 -07:00
|
|
|
path: |
|
2021-09-08 16:40:33 +08:00
|
|
|
${{ github.workspace }}/.ccache
|
2021-09-08 01:16:26 -07:00
|
|
|
~/.gradle/caches/build-cache-*
|
|
|
|
key: ${{ runner.os }}-build-cache-${{ github.sha }}
|
|
|
|
restore-keys: ${{ runner.os }}-build-cache-
|
2021-09-07 22:50:47 -07:00
|
|
|
|
2020-12-25 15:01:02 -08:00
|
|
|
- name: Set up NDK
|
2021-09-08 01:16:26 -07:00
|
|
|
run: python build.py -v ndk
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
- name: Build release
|
2021-09-07 22:50:47 -07:00
|
|
|
run: |
|
|
|
|
./ccache -zp
|
|
|
|
python build.py -vr all
|
2020-12-25 15:01:02 -08:00
|
|
|
|
|
|
|
- name: Build debug
|
2021-09-07 22:50:47 -07:00
|
|
|
run: |
|
|
|
|
python build.py -v all
|
|
|
|
./ccache -s
|
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
|