diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index cada4929..3bbea611 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -13,53 +13,65 @@ on: jobs: build: - - runs-on: ubuntu-latest + name: Build + runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: '17' + - name: Checkout Secret - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ secrets.SECRET_REPO }} token: ${{ secrets.TOKEN }} # Repo token path: secret + # Prepare secret files - name: Copy Secret Files run: | cd secret/AniVu cp key.jks ../.. cp secret.gradle.kts ../.. + # Clean secret files - name: Clean Temp Secret Files run: | rm -rf ./secret + # Build - name: Build with Gradle run: | bash ./gradlew assembleGitHubRelease + # Upload apk (arm64-v8a) - name: Upload Pre-Release Apk (arm64-v8a) uses: actions/upload-artifact@v4 with: name: Pre-Release Apk (arm64-v8a) path: app/build/outputs/apk/GitHub/release/*arm64-v8a*.apk + compression-level: 9 + # Upload apk (armeabi-v7a) - name: Upload Pre-Release Apk (armeabi-v7a) uses: actions/upload-artifact@v4 with: name: Pre-Release Apk (armeabi-v7a) path: app/build/outputs/apk/GitHub/release/*armeabi-v7a*.apk + compression-level: 9 + # Upload apk (x86_64) - name: Upload Pre-Release Apk (x86_64) uses: actions/upload-artifact@v4 with: name: Pre-Release Apk (x86_64) path: app/build/outputs/apk/GitHub/release/*x86_64*.apk + compression-level: 9 + # Upload apk (x86) - name: Upload Pre-Release Apk (x86) uses: actions/upload-artifact@v4 @@ -68,18 +80,24 @@ jobs: path: | app/build/outputs/apk/GitHub/release/*x86*.apk !app/build/outputs/apk/GitHub/release/*x86_64*.apk + compression-level: 9 + # Upload apk (universal) - name: Upload Pre-Release Apk (universal) uses: actions/upload-artifact@v4 with: name: Pre-Release Apk (universal) path: app/build/outputs/apk/GitHub/release/*universal*.apk + compression-level: 9 + # Upload mapping - name: Upload Pre-Release Mapping uses: actions/upload-artifact@v4 with: name: Pre-Release Mapping path: app/build/outputs/mapping/GitHubRelease/mapping.txt + compression-level: 9 + # Get apk path - name: Get Pre-Release Apk File Path run: | @@ -88,6 +106,7 @@ jobs: echo "PRE_RELEASE_APK_X86_64=$(find app/build/outputs/apk/GitHub/release -name '*x86_64*.apk' -type f | head -1)" >> $GITHUB_ENV echo "PRE_RELEASE_APK_X86=$(find app/build/outputs/apk/GitHub/release -name '*x86*.apk' -type f | head -1)" >> $GITHUB_ENV echo "PRE_RELEASE_APK_UNIVERSAL=$(find app/build/outputs/apk/GitHub/release -name '*universal*.apk' -type f | head -1)" >> $GITHUB_ENV + # Send to Telegram - name: Post to Telegram Channel if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[skip_post]') == false