Skip to content

doc: 更新 README.md #30

doc: 更新 README.md

doc: 更新 README.md #30

Workflow file for this run

name: Android CI
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: base64-to-file
id: write_file
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'key.jks'
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Write key
if: github.event_name != 'pull_request'
run: |
touch keystore.properties
echo storePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ steps.write_file.outputs.filePath }}' >> keystore.properties
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Cache gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/caches/build-cache-*
key: gradle-deps-core-${{ hashFiles('**/build.gradle.kts') }}
restore-keys: |
gradle-deps
- name: Install dep
run: |
sudo apt-get install -y ccache
ccache -o max_size=1G
ccache -o hash_dir=false
ccache -o compiler_check='%compiler% -dumpmachine; %compiler% -dumpversion'
ccache -zp
- name: Build with Gradle
run: |
[ $(du -s ~/.gradle/wrapper | awk '{ print $1 }') -gt 250000 ] && rm -rf ~/.gradle/wrapper/* || true
find ~/.gradle/caches -exec touch -d "2 days ago" {} + || true
echo 'org.gradle.caching=true' >> gradle.properties
echo 'org.gradle.parallel=true' >> gradle.properties
echo 'org.gradle.vfs.watch=true' >> gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g' >> gradle.properties
echo 'android.native.buildOutput=verbose' >> gradle.properties
chmod +x gradlew
./gradlew assembleRelease -Pkotlin.experimental.tryK2=true
ccache -s
- name: Upload assets to a Release
uses: meeDamian/github-release@v2.0.3
with:
files: app/build/outputs/apk/release/*.apk
token: ${{ secrets.RELEASE_TOKEN }}
allow_override: true
gzip: false
# - name: Release Lsposed Modules Repo
# uses: phuonghuynh/action-ghrelease@v1.1.0
# env:
# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
# with:
# tag_name: ${{ env.RELEASE_TAG }}
# repository: Xposed-Modules-Repo/cn.xihan.qdds
# files: app/build/outputs/apk/release/*.apk
# - name: Push a README.md to another repository
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.RELEASE_TOKEN }}
# with:
# source_file: 'README.md'
# destination_repo: 'Xposed-Modules-Repo/cn.xihan.qdds'
# user_email: 'srxqzxs@vip.qq.com'
# user_name: 'xihan123'
- name: Telegram Notify
uses: appleboy/telegram-action@master
with:
token: ${{ secrets.BOT_TOKEN }}
to: ${{ secrets.CHANGELOG_CHANNEL_ID }}
message: |
Here is the signed APK for ${{ github.event_name }}
Runner OS: ${{ runner.os }}
Event: ${{ github.event_name }}
Job ID: ${{ github.job }}
Triggered by: ${{ github.actor }}
Branch or TAG: ${{ github.ref }}
Base ref: ${{ github.base_ref }}
Head ref: ${{ github.head_ref }}
Commit SHA: ${{ github.sha }}
document: app/build/outputs/apk/release/*.apk