迁移项目到 Vite #276
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build CI For Android | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 设置权限 | |
run: chmod -R 755 ./src-capacitor/android/ | |
- name: 设置 JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: 设置 Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: 设置环境变量 | |
run: export PATH=$PATH:$ANDROID_SDK_ROOT/tools; PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools | |
- name: 设置 Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: 安装依赖 | |
run: npm i | |
- name: 构建 Android | |
run: npm run build:android | |
- name: 上传 Apk | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release-unsigned | |
path: ./dist/capacitor/android/apk/release/app-release-unsigned.apk |