Build Libs And Unsigned APK #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Libs And Unsigned APK | |
on: | |
# push: | |
# tags: | |
# - 'v*' # 触发条件:当推送标签以 'v' 开头时 | |
workflow_dispatch: # 允许手动触发工作流 | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 # 使用 Ubuntu 运行环境 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# with: | |
# submodules: true | |
# repository: catpuppyapp/PuppyGit | |
# fetch-depth: 1 | |
# ref: main | |
# path: PuppyGit # if set, must use `$GITHUB_WORKSPACE/PuppyGit` to access the dir, else can simple use `$GITHUB_WORKSPACE` | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' # 设置 JDK 版本 | |
distribution: 'temurin' # 指定 JDK 发行版(例如 'adopt', 'zulu', 'temurin', 'oracle' 等) | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y \ | |
curl \ | |
make \ | |
tar \ | |
maven \ | |
unzip \ | |
git | |
# | |
# - name: Setup cmake | |
# uses: jwlawson/actions-setup-cmake@v2 | |
# with: | |
# cmake-version: '3.31.1' | |
- name: Install Require Software | |
run: bash $GITHUB_WORKSPACE/lib_build_scripts/1_installrequire.sh | |
- name: Download Src | |
run: bash $GITHUB_WORKSPACE/lib_build_scripts/2_downloadsrc.sh | |
- name: Build C Libs | |
run: | | |
export ppgit_c_lib_out=$GITHUB_WORKSPACE/app/src/main/jniLibs | |
cd $GITHUB_WORKSPACE/lib_build_scripts | |
rm -rf $ppgit_c_lib_out/* | |
bash 3_buildlibs.sh $ppgit_c_lib_out | |
- name: "List C Libs" | |
run: ls -R $GITHUB_WORKSPACE/app/src/main/jniLibs | |
- name: Upload C Libs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: c_libs | |
path: ${{ github.workspace }}/app/src/main/jniLibs/ | |
retention-days: 15 | |
- name: Build Release APK | |
run: | | |
cd $GITHUB_WORKSPACE | |
chmod +x gradlew | |
./gradlew clean | |
./gradlew assembleRelease | |
- name: Upload Release APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-release-unsigned.apk | |
path: ${{ github.workspace }}/app/build/outputs/apk/release/app-release-unsigned.apk | |
retention-days: 15 | |
- name: Build Debug APK | |
run: | | |
cd $GITHUB_WORKSPACE | |
chmod +x gradlew | |
./gradlew clean | |
./gradlew assembleDebug | |
- name: Upload Debug APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-debug-unsigned.apk | |
path: ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk | |
retention-days: 15 | |