Opti Actions

update clean.yml
auto ci build

Bumps the actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/setup-java](https://github.com/actions/setup-java) and [gradle/actions](https://github.com/gradle/actions).

Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

Updates `actions/setup-java` from 4 to 5
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

Updates `gradle/actions` from 4 to 5
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: gradle/actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>

Update clean.yml
This commit is contained in:
NkBe 2025-10-01 18:55:22 +08:00 committed by NkBe(HSSkyBoy)
parent dbacad9876
commit 02c9d34f5a
No known key found for this signature in database
GPG Key ID: 525137026FF031DF
2 changed files with 67 additions and 38 deletions

View File

@ -1,27 +1,30 @@
name: Build CI
name: CI Build
on:
workflow_dispatch:
pull_request:
push:
merge_group:
jobs:
build:
runs-on: macos-latest
name: Build
runs-on: ubuntu-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
uses: actions/checkout@v5
with:
submodules: recursive
ref: ${{ github.sha }}
submodules: 'recursive'
fetch-depth: 0
- name: Cache Gradle
- name: Cache CCACHE
uses: actions/cache@v4
with:
path: |
@ -37,15 +40,17 @@ jobs:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/build.gradle*') }}
restore-keys: |
${{ runner.os }}-m2-
${{ runner.os }}-ccache-
- name: Cache ccache
- name: Cache Android Build Cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('**/src/**/*.cpp', '**/src/**/*.h', '**/CMakeLists.txt') }}
path: |
~/.android/build-cache
~/.gradle/caches/modules-2
key: ${{ runner.os }}-android-build-cache-${{ hashFiles('**/build.gradle*', '**/*.versions.toml') }}
restore-keys: |
${{ runner.os }}-ccache-
${{ runner.os }}-android-build-cache-
- name: Write signing key if needed
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
@ -72,13 +77,13 @@ jobs:
path: libxposed/service
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
- name: Setup Android SDK
uses: android-actions/setup-android@v3
@ -89,43 +94,53 @@ jobs:
version: 1.12.0
- name: Remove Android's cmake
run: rm -rf $ANDROID_HOME/cmake
shell: bash
run: rm -rf "$ANDROID_HOME/cmake"
- name: Build local dependencies
- name: Setup build environment properties
run: |
echo "--- Building API dependency ---"
cd libxposed/api
./gradlew :api:publishApiPublicationToMavenLocal --no-daemon
echo "--- Building Service Interface dependency ---"
# for libxposed/api build
echo 'org.gradle.jvmargs=-Xmx2048m' >> libxposed/api/gradle.properties
# for main project build
{
echo 'org.gradle.parallel=true'
echo 'org.gradle.jvmargs=-Xmx2048m'
echo 'android.native.buildOutput=verbose'
} >> gradle.properties
- name: Build dependencies with Gradle
working-directory: libxposed
run: |
cd api
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :api:publishApiPublicationToMavenLocal
cd ../service
./gradlew :interface:publishInterfacePublicationToMavenLocal --no-daemon
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :interface:publishInterfacePublicationToMavenLocal
- 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=-Xmx3g' >> gradle.properties
echo 'android.native.buildOutput=verbose' >> gradle.properties
./gradlew buildAll
- name: Upload Debug artifact
uses: actions/upload-artifact@v4
with:
name: npatch-debug
path: out/debug/*
run: ./gradlew buildAll
- name: Upload Release artifact
uses: actions/upload-artifact@v4
with:
name: npatch-release
name: npatch-release-${{ env.commit }}
path: out/release/*
- name: Upload Debug artifact
uses: actions/upload-artifact@v4
with:
name: npatch-debug-${{ env.commit }}
path: out/debug/*
- name: Upload mappings
uses: actions/upload-artifact@v4
with:
name: mappings
name: mappings-${{ env.commit }}
path: |
patch-loader/build/outputs/mapping
manager/build/outputs/mapping
@ -133,6 +148,6 @@ jobs:
- name: Upload symbols
uses: actions/upload-artifact@v4
with:
name: symbols
name: symbols-${{ env.commit }}
path: |
patch-loader/build/symbols
patch-loader/build/symbols

View File

@ -1,4 +1,4 @@
name: Clean Gradle Cache
name: Clean Build
on:
workflow_dispatch:
@ -14,4 +14,18 @@ jobs:
run: rm -rf ~/.m2/repository/
- name: 删除 ccache 缓存
run: rm -rf ~/.ccache/
run: rm -rf ~/.ccache/
cleanup-runs:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: 清理所有失敗的 Workflows
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 1
delete_run_by_conclusion_pattern: 'failure,skipped'