Adjust workflows
This commit is contained in:
parent
10b291bd61
commit
61cf11ee0e
|
|
@ -1,14 +1,11 @@
|
||||||
name: Android CI
|
name: Build Android CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build on Ubuntu
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
||||||
|
|
@ -19,6 +16,7 @@ jobs:
|
||||||
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
|
||||||
|
|
@ -51,7 +49,7 @@ jobs:
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
distribution: 'temurin'
|
distribution: 'adopt'
|
||||||
|
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
@ -68,44 +66,41 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: rm -rf $ANDROID_HOME/cmake
|
run: rm -rf $ANDROID_HOME/cmake
|
||||||
|
|
||||||
- name: Build dependencies with Gradle
|
- name: Build local dependencies
|
||||||
working-directory: libxposed
|
|
||||||
run: |
|
run: |
|
||||||
cd api
|
echo "--- Building API dependency ---"
|
||||||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
|
cd libxposed/api
|
||||||
./gradlew :api:publishApiPublicationToMavenLocal
|
./gradlew :api:publishApiPublicationToMavenLocal
|
||||||
|
echo "--- Building Service Interface dependency ---"
|
||||||
cd ../service
|
cd ../service
|
||||||
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
|
|
||||||
./gradlew :interface:publishInterfacePublicationToMavenLocal
|
./gradlew :interface:publishInterfacePublicationToMavenLocal
|
||||||
|
|
||||||
- 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 core with Gradle
|
- name: Build with Gradle
|
||||||
run: |
|
run: |
|
||||||
{
|
echo 'org.gradle.parallel=true' >> gradle.properties
|
||||||
echo 'org.gradle.parallel=true'
|
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
|
||||||
echo 'org.gradle.jvmargs=-Xmx2048m'
|
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-${{ env.commit }}
|
name: lspatch-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-${{ env.commit }}
|
name: lspatch-release
|
||||||
path: out/release/*
|
path: out/release/*
|
||||||
|
|
||||||
- name: Upload mappings
|
- name: Upload mappings
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: mappings-${{ env.commit }}
|
name: mappings
|
||||||
path: |
|
path: |
|
||||||
patch-loader/build/outputs/mapping
|
patch-loader/build/outputs/mapping
|
||||||
manager/build/outputs/mapping
|
manager/build/outputs/mapping
|
||||||
|
|
@ -113,26 +108,6 @@ jobs:
|
||||||
- name: Upload symbols
|
- name: Upload symbols
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: symbols-${{ env.commit }}
|
name: symbols
|
||||||
path: |
|
path: |
|
||||||
patch-loader/build/symbols
|
patch-loader/build/symbols
|
||||||
|
|
||||||
- name: Post to channel
|
|
||||||
if: ${{ github.event_name != 'pull_request' && success() && github.ref == 'refs/heads/master' }} && false
|
|
||||||
env:
|
|
||||||
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
|
|
||||||
DISCUSSION_ID: ${{ secrets.DISCUSSION_ID }}
|
|
||||||
TOPIC_ID: ${{ secrets.TOPIC_ID }}
|
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
|
||||||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
|
||||||
COMMIT_URL: ${{ github.event.head_commit.url }}
|
|
||||||
run: |
|
|
||||||
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
|
|
||||||
export jarRelease=$(find out/release -name "*.jar")
|
|
||||||
export managerRelease=$(find out/release -name "*.apk")
|
|
||||||
export jarDebug=$(find out/debug -name "*.jar")
|
|
||||||
export managerDebug=$(find out/debug -name "*.apk")
|
|
||||||
ESCAPED=`python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.environ["COMMIT_MESSAGE"]); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.environ["COMMIT_URL"])))'`
|
|
||||||
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FjarRelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FmanagerRelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FjarDebug%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FmanagerDebug%22%2C%22caption%22:${ESCAPED}%7D%5D" -F jarRelease="@$jarRelease" -F managerRelease="@$managerRelease" -F jarDebug="@$jarDebug" -F managerDebug="@$managerDebug"
|
|
||||||
# curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${DISCUSSION_ID}&message_thread_id=${TOPIC_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FjarRelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FmanagerRelease%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FjarDebug%22%7D%2C%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2FmanagerDebug%22%2C%22caption%22:${ESCAPED}%7D%5D" -F jarRelease="@$jarRelease" -F managerRelease="@$managerRelease" -F jarDebug="@$jarDebug" -F managerDebug="@$managerDebug"
|
|
||||||
fi
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue