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:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build on Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
||||
CCACHE_NOHASHDIR: 'true'
|
||||
CCACHE_HARDLINK: 'true'
|
||||
CCACHE_BASEDIR: '${{ github.workspace }}'
|
||||
CCACHE_BASEDIR: ${{ github.workspace }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Write key
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
|
||||
- name: Cache Gradle
|
||||
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: |
|
||||
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
|
||||
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
|
||||
|
|
@ -63,38 +87,37 @@ jobs:
|
|||
version: 1.12.0
|
||||
|
||||
- name: Remove Android's cmake
|
||||
shell: bash
|
||||
run: rm -rf $ANDROID_HOME/cmake
|
||||
|
||||
- name: Build local dependencies
|
||||
run: |
|
||||
echo "--- Building API dependency ---"
|
||||
cd libxposed/api
|
||||
./gradlew :api:publishApiPublicationToMavenLocal
|
||||
./gradlew :api:publishApiPublicationToMavenLocal --no-daemon
|
||||
echo "--- Building Service Interface dependency ---"
|
||||
cd ../service
|
||||
./gradlew :interface:publishInterfacePublicationToMavenLocal
|
||||
./gradlew :interface:publishInterfacePublicationToMavenLocal --no-daemon
|
||||
|
||||
- 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
|
||||
run: |
|
||||
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
|
||||
./gradlew buildAll
|
||||
|
||||
- name: Upload Debug artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: lspatch-debug
|
||||
name: npatch-debug
|
||||
path: out/debug/*
|
||||
|
||||
- name: Upload Release artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: lspatch-release
|
||||
name: npatch-release
|
||||
path: out/release/*
|
||||
|
||||
- name: Upload mappings
|
||||
Loading…
Reference in New Issue