Skip to content

Commit

Permalink
[build] Running build on macos-latest (#36) [skip_post]
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsummer233 authored Sep 8, 2024
1 parent 0962f7e commit 9afd8c9
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,74 +13,92 @@ 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/Rays-Android
cp key.jks ../..
cp secret.gradle.kts ../..
cp -rf assets ../../app/src/main
# 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@v3
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@v3
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@v3
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@v3
uses: actions/upload-artifact@v4
with:
name: Pre-Release Apk (x86)
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@v3
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@v3
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 @@ -89,6 +107,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 9afd8c9

Please sign in to comment.