2024-01-29 01:36:51 -08:00
|
|
|
name: Magisk Setup
|
2024-08-18 21:42:28 -07:00
|
|
|
inputs:
|
|
|
|
is-asset-build:
|
|
|
|
required: false
|
|
|
|
default: false
|
2024-01-29 01:36:51 -08:00
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
|
|
|
- name: Set up JDK 17
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
with:
|
|
|
|
distribution: "temurin"
|
2024-08-26 18:34:49 +08:00
|
|
|
java-version: "21"
|
2024-01-29 01:36:51 -08:00
|
|
|
|
|
|
|
- name: Set up Python 3
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
|
|
|
|
2024-08-21 16:51:30 -07:00
|
|
|
- name: Install GNU make
|
2024-08-14 15:24:05 -07:00
|
|
|
if: runner.os == 'macOS'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
brew install make
|
|
|
|
echo 'GNUMAKE=gmake' >> "$GITHUB_ENV"
|
|
|
|
|
2024-08-21 16:51:30 -07:00
|
|
|
- name: Cache sccache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
2024-08-21 22:06:12 -07:00
|
|
|
path: .sccache
|
2024-08-21 16:51:30 -07:00
|
|
|
key: sccache-${{ runner.os }}-${{ github.sha }}
|
|
|
|
restore-keys: sccache-${{ runner.os }}-
|
|
|
|
|
|
|
|
- name: Set up sccache
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
SCCACHE_DIRECT: false
|
|
|
|
SCCACHE_DIR: ${{ github.workspace }}/.sccache
|
|
|
|
SCCACHE_CACHE_SIZE: 2G
|
|
|
|
SCCACHE_IDLE_TIMEOUT: 0
|
|
|
|
run: |
|
|
|
|
bash $GITHUB_ACTION_PATH/sccache.sh
|
|
|
|
sccache --start-server
|
|
|
|
sccache -z
|
|
|
|
|
|
|
|
- name: Show sccache stats
|
|
|
|
uses: gacts/run-and-post-run@v1
|
|
|
|
with:
|
|
|
|
run: sccache -s
|
|
|
|
post: sccache -s
|
|
|
|
|
2024-08-21 22:06:12 -07:00
|
|
|
- name: Set GRADLE_USER_HOME
|
|
|
|
shell: bash
|
|
|
|
run: echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/.gradle" >> "$GITHUB_ENV"
|
|
|
|
|
2024-01-29 01:36:51 -08:00
|
|
|
- name: Cache Gradle dependencies
|
2024-01-29 01:53:09 -08:00
|
|
|
uses: actions/cache@v4
|
2024-08-18 21:42:28 -07:00
|
|
|
if: inputs.is-asset-build == 'true'
|
2024-01-29 01:36:51 -08:00
|
|
|
with:
|
|
|
|
path: |
|
2024-08-21 22:06:12 -07:00
|
|
|
.gradle/caches
|
|
|
|
.gradle/wrapper
|
|
|
|
!.gradle/caches/build-cache-*
|
2024-08-18 21:42:28 -07:00
|
|
|
key: gradle-cache-${{ hashFiles('gradle/**') }}
|
|
|
|
restore-keys: gradle-cache-
|
2024-01-29 01:36:51 -08:00
|
|
|
|
2024-08-18 21:42:28 -07:00
|
|
|
- name: Restore Gradle dependencies
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
if: inputs.is-asset-build == 'false'
|
|
|
|
with:
|
|
|
|
path: |
|
2024-08-21 22:06:12 -07:00
|
|
|
.gradle/caches
|
|
|
|
.gradle/wrapper
|
|
|
|
!.gradle/caches/build-cache-*
|
2024-08-18 21:42:28 -07:00
|
|
|
key: gradle-cache-${{ hashFiles('gradle/**') }}
|
|
|
|
restore-keys: gradle-cache-
|
2024-08-21 22:06:12 -07:00
|
|
|
enableCrossOsArchive: true
|
2024-08-18 21:42:28 -07:00
|
|
|
|
|
|
|
- name: Cache Gradle build cache
|
2024-01-29 01:53:09 -08:00
|
|
|
uses: actions/cache@v4
|
2024-08-18 21:42:28 -07:00
|
|
|
if: inputs.is-asset-build == 'true'
|
|
|
|
with:
|
|
|
|
path: |
|
2024-08-21 22:06:12 -07:00
|
|
|
.gradle/caches/build-cache-*
|
2024-08-18 21:42:28 -07:00
|
|
|
key: gradle-build-cache-${{ github.sha }}
|
|
|
|
restore-keys: gradle-build-cache-
|
|
|
|
|
|
|
|
- name: Restore Gradle build cache
|
|
|
|
uses: actions/cache/restore@v4
|
|
|
|
if: inputs.is-asset-build == 'false'
|
2024-01-29 01:36:51 -08:00
|
|
|
with:
|
|
|
|
path: |
|
2024-08-21 22:06:12 -07:00
|
|
|
.gradle/caches/build-cache-*
|
2024-08-18 21:42:28 -07:00
|
|
|
key: gradle-build-cache-${{ github.sha }}
|
|
|
|
restore-keys: gradle-build-cache-
|
2024-08-21 22:06:12 -07:00
|
|
|
enableCrossOsArchive: true
|
2024-01-29 01:36:51 -08:00
|
|
|
|
|
|
|
- name: Set up NDK
|
|
|
|
shell: bash
|
2024-08-21 16:51:30 -07:00
|
|
|
run: python build.py -v ndk
|