Update workflow dependencies (#1)

Also add commit ID to distinguish artifacts.
This commit is contained in:
Syuugo 2024-05-25 22:58:54 +09:00 committed by JingMatrix
parent 04a75ce3e8
commit 4717b41ef5
2 changed files with 30 additions and 28 deletions

1
.gitattributes vendored
View File

@ -8,3 +8,4 @@
# Denote all files that are truly binary and should not be modified. # Denote all files that are truly binary and should not be modified.
*.so binary *.so binary
*.dex binary *.dex binary
*.jar binary

View File

@ -1,18 +1,15 @@
name: Android CI name: Android CI
on: on:
workflow_dispatch:
push: push:
branches: [ master ] branches: [ master ]
pull_request: pull_request:
workflow_dispatch:
jobs: jobs:
build: build:
name: Build on ${{ matrix.os }} name: Build
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest ]
env: env:
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion' CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
CCACHE_NOHASHDIR: 'true' CCACHE_NOHASHDIR: 'true'
@ -21,7 +18,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: 'recursive' submodules: 'recursive'
fetch-depth: 0 fetch-depth: 0
@ -50,66 +47,70 @@ jobs:
path: libxposed/service path: libxposed/service
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
java-version: '21' java-version: '21'
distribution: 'temurin' distribution: 'temurin'
- name: Setup Gradle - name: Setup Gradle
uses: gradle/gradle-build-action@v2 uses: gradle/actions/setup-gradle@v3
with: with:
gradle-home-cache-cleanup: true gradle-home-cache-cleanup: true
- name: Setup ccache - name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1
with: with:
max-size: 2G max-size: 2G
key: ${{ runner.os }} key: lsp
restore-keys: ${{ runner.os }} restore-keys: lsp
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Build dependencies - name: Build dependencies with Gradle
working-directory: libxposed working-directory: libxposed
run: | run: |
cd api cd api
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :api:publishApiPublicationToMavenLocal ./gradlew :api:publishApiPublicationToMavenLocal
cd .. cd ../service
cd service
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :interface:publishInterfacePublicationToMavenLocal ./gradlew :interface:publishInterfacePublicationToMavenLocal
- name: Build with Gradle - name: Set short commit id
run: echo "commit=$(echo ${{ github.sha }} | cut -c-7)" > $GITHUB_ENV
- name: Build core with Gradle
run: | run: |
echo 'org.gradle.parallel=true' >> gradle.properties {
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties echo 'org.gradle.parallel=true'
echo 'android.native.buildOutput=verbose' >> gradle.properties echo 'org.gradle.jvmargs=-Xmx2048m'
echo 'android.native.buildOutput=verbose'
} >> gradle.properties
./gradlew buildAll ./gradlew buildAll
- name: Upload Debug artifact - name: Upload Debug artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: lspatch-debug name: lspatch-debug-${{ env.commit }}
path: out/debug/* path: out/debug/*
- name: Upload Release artifact - name: Upload Release artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: lspatch-release name: lspatch-release-${{ env.commit }}
path: out/release/* path: out/release/*
- name: Upload mappings - name: Upload mappings
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: mappings name: mappings-${{ env.commit }}
path: | path: |
patch-loader/build/outputs/mapping patch-loader/build/outputs/mapping
manager/build/outputs/mapping manager/build/outputs/mapping
- name: Upload symbols - name: Upload symbols
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: symbols name: symbols-${{ env.commit }}
path: | path: |
patch-loader/build/symbols patch-loader/build/symbols