Add simplified debug build workflow
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
name: Build Debug
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
# ==================== Android Debug 构建 ====================
|
||||
build-android-debug:
|
||||
name: Build Android Debug APK
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'temurin'
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: |
|
||||
cd Android-kotlin-Code
|
||||
chmod +x gradlew
|
||||
|
||||
- name: Create local.properties
|
||||
run: |
|
||||
cd Android-kotlin-Code
|
||||
echo "sdk.dir=$ANDROID_HOME" > local.properties
|
||||
|
||||
- name: Build Android Debug APK
|
||||
run: |
|
||||
cd Android-kotlin-Code
|
||||
./gradlew app:assembleMeta-AlphaDebug --stacktrace
|
||||
|
||||
- name: Upload Android Debug APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-debug-apk
|
||||
path: Android-kotlin-Code/app/build/outputs/apk/**/*.apk
|
||||
retention-days: 7
|
||||
|
||||
# ==================== iOS Debug 构建 ====================
|
||||
build-ios-debug:
|
||||
name: Build iOS Debug App
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Xcode
|
||||
uses: maxim-lobanov/setup-xcode@v1
|
||||
with:
|
||||
xcode-version: '15.0'
|
||||
|
||||
- name: Show Xcode version
|
||||
run: |
|
||||
xcodebuild -version
|
||||
swift --version
|
||||
|
||||
- name: Resolve Swift Package Dependencies
|
||||
run: |
|
||||
cd iOS-SwiftUI-Code
|
||||
xcodebuild -resolvePackageDependencies -project uuvpn.xcodeproj -scheme SFI
|
||||
|
||||
- name: Build iOS Debug App
|
||||
run: |
|
||||
cd iOS-SwiftUI-Code
|
||||
xcodebuild clean build \
|
||||
-project uuvpn.xcodeproj \
|
||||
-scheme SFI \
|
||||
-sdk iphonesimulator \
|
||||
-destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' \
|
||||
-configuration Debug \
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
CODE_SIGNING_REQUIRED=NO
|
||||
|
||||
- name: Find and upload iOS Debug App
|
||||
run: |
|
||||
cd iOS-SwiftUI-Code
|
||||
# 查找生成的 .app 文件
|
||||
APP_PATH=$(find ~/Library/Developer/Xcode/DerivedData -name "*.app" -type d | head -n 1)
|
||||
if [ -n "$APP_PATH" ]; then
|
||||
echo "Found app at: $APP_PATH"
|
||||
mkdir -p build
|
||||
cp -R "$APP_PATH" build/
|
||||
# 创建 zip 文件以便上传
|
||||
cd build
|
||||
zip -r ios-debug-app.zip *.app
|
||||
else
|
||||
echo "No .app file found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Upload iOS Debug App
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-debug-app
|
||||
path: iOS-SwiftUI-Code/build/ios-debug-app.zip
|
||||
retention-days: 7
|
||||
Reference in New Issue
Block a user