Skip to content

Commit

Permalink
[build] Running build on macos-latest (#90) [skip_post]
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsummer233 authored Sep 7, 2024
1 parent ff3f5fa commit 21318f3
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand Down

0 comments on commit 21318f3

Please sign in to comment.