build(deps): bump the actions group with 3 updates #109
This file contains hidden or 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: CI Build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| merge_group: | |
| jobs: | |
| build: | |
| name: 構建 | |
| runs-on: ubuntu-latest | |
| env: | |
| CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion' | |
| CCACHE_NOHASHDIR: 'true' | |
| CCACHE_HARDLINK: 'true' | |
| CCACHE_BASEDIR: '${{ github.workspace }}' | |
| steps: | |
| - name: 檢出程式碼 | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.sha }} | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - name: 設定快取 | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.ccache | |
| key: ${{ runner.os }}-ccache-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-ccache- | |
| - name: 如果需要,則寫入簽名密鑰 | |
| if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
| run: | | |
| if [ ! -z "${{ secrets.KEY_STORE }}" ]; then | |
| echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties | |
| echo androidKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties | |
| echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties | |
| echo androidStoreFile='key.jks' >> gradle.properties | |
| echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks | |
| fi | |
| - name: 檢出 libxposed/api | |
| uses: actions/checkout@main | |
| with: | |
| repository: libxposed/api | |
| path: libxposed/api | |
| - name: 檢出 libxposed/service | |
| uses: actions/checkout@main | |
| with: | |
| repository: libxposed/service | |
| path: libxposed/service | |
| - name: 設定 Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21' | |
| distribution: 'zulu' | |
| - name: 設定 Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: 設定 Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: 設定 ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| with: | |
| version: 1.12.1 | |
| - name: 設定 CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '4.1.1' | |
| - name: 移除 Android 的 cmake | |
| shell: bash | |
| run: rm -rf "$ANDROID_HOME/cmake" | |
| - name: 設定構建環境 | |
| run: | | |
| # for libxposed/api build | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> libxposed/api/gradle.properties | |
| # for main project build | |
| { | |
| echo 'org.gradle.parallel=true' | |
| echo 'org.gradle.jvmargs=-Xmx2048m' | |
| echo 'android.native.buildOutput=verbose' | |
| } >> gradle.properties | |
| # for libxposed build | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> libxposed/api/gradle.properties | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> libxposed/service/gradle.properties | |
| - name: 授予 gradlew 執行權限 | |
| run: chmod +x gradlew | |
| - name: 使用 Gradle 構建依賴項 | |
| working-directory: libxposed | |
| run: | | |
| cd api | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties | |
| ./gradlew :api:publishApiPublicationToMavenLocal | |
| cd ../service | |
| echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties | |
| ./gradlew :interface:publishInterfacePublicationToMavenLocal | |
| - name: 設定 commit id | |
| run: echo "commit=$(echo ${{ github.sha }} | cut -c-7)" > $GITHUB_ENV | |
| - name: 使用 Gradle 構建 | |
| run: ./gradlew buildAll | |
| - name: 上傳 Release Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: npatch-release-${{ env.commit }} | |
| path: out/release/* | |
| retention-days: 14 | |
| - name: 上傳 Debug Artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: npatch-debug-${{ env.commit }} | |
| path: out/debug/* | |
| retention-days: 7 | |
| - name: 上傳 mappings | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: mappings-${{ env.commit }} | |
| path: | | |
| patch-loader/build/outputs/mapping | |
| manager/build/outputs/mapping | |
| - name: 上傳 symbols | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: symbols-${{ env.commit }} | |
| path: | | |
| patch-loader/build/symbols |