diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..49d5557 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,30 @@ +name: Build and Package App + +on: + workflow_dispatch: # 手动触发工作流 + +jobs: + build: + runs-on: ubuntu-latest # 使用最新的 Ubuntu 环境 + + steps: + - name: Checkout code + uses: actions/checkout@v3 # 使用最新版本 + + - name: Set up JDK + uses: actions/setup-java@v3 # 使用最新版本 + with: + java-version: '11' # 设置 Java 版本 + distribution: 'adopt' # 添加缺失的输入参数 + + - name: Build with Gradle + run: ./gradlew build # 使用 Gradle 构建项目 + + - name: Package APK + run: ./gradlew assembleRelease # 打包 APK + + - name: Upload APK + uses: actions/upload-artifact@v3 # 使用最新版本 + with: + name: my-app-apk + path: app/build/outputs/apk/release/app-release.apk # 上传生成的 APK