Skip to content

Manual Release

Manual Release #26

name: Manual Release
on:
workflow_dispatch:
inputs:
draft:
description: "Publish as draft"
type: boolean
default: true
publish:
description: "Publish to Xposed Module Repository"
type: boolean
default: false
jobs:
build_inject_tool:
runs-on: ubuntu-latest
steps:
- name: Checking out InjectTool
uses: actions/checkout@v4
with:
repository: TinyHai/InjectTool
fetch-depth: 0
- name: Setup rustup
run: |
rustup update stable
- uses: Swatinem/rust-cache@v2
with:
cache-targets: false
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev 66845c1
- name: Build InejctTool
run: |
./build.sh
- name: Upload InjectTool
uses: actions/upload-artifact@v4
with:
name: InjectTool
path: out/
build_lspatch:
runs-on: ubuntu-latest
steps:
- name: Checking out LSPatch
uses: actions/checkout@v4
with:
repository: TinyHai/LSPatch
ref: 'dev'
submodules: 'recursive'
fetch-depth: 0
- name: Checkout libxposed/api
uses: actions/checkout@v4
with:
ref: 'a42f85d06eac3373d266a534ab3b31a584b30774'
repository: libxposed/api
path: libxposed/api
- name: Checkout libxposed/service
uses: actions/checkout@v4
with:
ref: '4351a735755c86c031a977a62e52005b23048c4d'
repository: libxposed/service
path: libxposed/service
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 2G
key: ${{ runner.os }}
restore-keys: ${{ runner.os }}
save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Build dependencies
working-directory: libxposed
run: |
cd api
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :api:publishApiPublicationToMavenLocal
cd ..
cd service
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
./gradlew :interface:publishInterfacePublicationToMavenLocal
- name: Build with Gradle
run: |
echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
echo 'android.native.buildOutput=verbose' >> gradle.properties
./gradlew buildAll
- name: Upload Release Assets
uses: actions/upload-artifact@v4
with:
name: LSPatchReleaseAssets
path: out/assets/release/
- name: Upload Debug Assets
uses: actions/upload-artifact@v4
with:
name: LSPatchDebugAssets
path: out/assets/debug/
build_apk:
needs: [build_inject_tool, build_lspatch]
runs-on: ubuntu-latest
steps:
- name: Checking out branch
uses: actions/checkout@v4
- name: Download LSPatchReleaseAssets
uses: actions/download-artifact@v4
with:
name: LSPatchReleaseAssets
path: app/src/main/assets
- name: Download InjectTool
uses: actions/download-artifact@v4
with:
name: InjectTool
path: app/src/main/jniLibs
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-home-cache-cleanup: true
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" >> jks.base64
base64 -d jks.base64 > keystore.jks
- name: Build with Gradle
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
./gradlew clean buildRelease
- name: Generate tag name
run: |
VERSION_CODE=$(cat ./app/build/outputs/apk/release/versionCode)
VERSION_NAME=$(cat ./app/build/outputs/apk/release/versionName)
echo "TAG_NAME=$VERSION_CODE-$VERSION_NAME" >> $GITHUB_ENV
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: BanUninstall
path: app/build/outputs/apk/**/*.apk
- name: Release to current repository
uses: softprops/action-gh-release@v2
with:
name: ${{ format('BanUninstall_{0}', env.TAG_NAME) }}
draft: ${{ inputs.draft }}
tag_name: ${{ env.TAG_NAME }}
body_path: ${{ github.workspace }}/CHANGELOG.md
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
files: |
app/build/outputs/apk/**/*.apk
- name: Release to xposed module repository
uses: softprops/action-gh-release@v2
if: ${{ inputs.publish }}
with:
name: ${{ format('BanUninstall_{0}', env.TAG_NAME) }}
tag_name: ${{ env.TAG_NAME }}
body_path: ${{ github.workspace }}/CHANGELOG.md
repository: Xposed-Modules-Repo/cn.tinyhai.ban_uninstall
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
files: |
app/build/outputs/apk/release/*.apk