Adjust Workflows
This commit is contained in:
parent
7142050894
commit
2f23001a8e
|
|
@ -0,0 +1,17 @@
|
||||||
|
name: Clean Gradle Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clean:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 删除 Gradle 缓存
|
||||||
|
run: rm -rf ~/.gradle/caches/
|
||||||
|
|
||||||
|
- name: 删除 m2 缓存
|
||||||
|
run: rm -rf ~/.m2/repository/
|
||||||
|
|
||||||
|
- name: 删除 ccache 缓存
|
||||||
|
run: rm -rf ~/.ccache/
|
||||||
|
|
@ -1,28 +1,52 @@
|
||||||
name: Build Android CI
|
name: Build CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build on Ubuntu
|
runs-on: macos-latest
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
env:
|
||||||
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
||||||
CCACHE_NOHASHDIR: 'true'
|
CCACHE_NOHASHDIR: 'true'
|
||||||
CCACHE_HARDLINK: 'true'
|
CCACHE_HARDLINK: 'true'
|
||||||
CCACHE_BASEDIR: '${{ github.workspace }}'
|
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Write key
|
- name: Cache Gradle
|
||||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Cache Maven local repo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.m2/repository
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/build.gradle*') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-m2-
|
||||||
|
|
||||||
|
- name: Cache ccache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.ccache
|
||||||
|
key: ${{ runner.os }}-ccache-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-ccache-
|
||||||
|
|
||||||
|
- name: Write signing key if needed
|
||||||
|
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
|
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
|
||||||
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
|
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
|
||||||
|
|
@ -63,38 +87,37 @@ jobs:
|
||||||
version: 1.12.0
|
version: 1.12.0
|
||||||
|
|
||||||
- name: Remove Android's cmake
|
- name: Remove Android's cmake
|
||||||
shell: bash
|
|
||||||
run: rm -rf $ANDROID_HOME/cmake
|
run: rm -rf $ANDROID_HOME/cmake
|
||||||
|
|
||||||
- name: Build local dependencies
|
- name: Build local dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "--- Building API dependency ---"
|
echo "--- Building API dependency ---"
|
||||||
cd libxposed/api
|
cd libxposed/api
|
||||||
./gradlew :api:publishApiPublicationToMavenLocal
|
./gradlew :api:publishApiPublicationToMavenLocal --no-daemon
|
||||||
echo "--- Building Service Interface dependency ---"
|
echo "--- Building Service Interface dependency ---"
|
||||||
cd ../service
|
cd ../service
|
||||||
./gradlew :interface:publishInterfacePublicationToMavenLocal
|
./gradlew :interface:publishInterfacePublicationToMavenLocal --no-daemon
|
||||||
|
|
||||||
- name: Set short commit id
|
- name: Set short commit id
|
||||||
run: echo "commit=$(echo ${{ github.sha }} | cut -c-7)" > $GITHUB_ENV
|
run: echo "commit=$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: |
|
run: |
|
||||||
echo 'org.gradle.parallel=true' >> gradle.properties
|
echo 'org.gradle.parallel=true' >> gradle.properties
|
||||||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
|
echo 'org.gradle.jvmargs=-Xmx3g' >> gradle.properties
|
||||||
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
||||||
./gradlew buildAll
|
./gradlew buildAll
|
||||||
|
|
||||||
- name: Upload Debug artifact
|
- name: Upload Debug artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lspatch-debug
|
name: npatch-debug
|
||||||
path: out/debug/*
|
path: out/debug/*
|
||||||
|
|
||||||
- name: Upload Release artifact
|
- name: Upload Release artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: lspatch-release
|
name: npatch-release
|
||||||
path: out/release/*
|
path: out/release/*
|
||||||
|
|
||||||
- name: Upload mappings
|
- name: Upload mappings
|
||||||
Loading…
Reference in New Issue