feat(new-game): 实现开局环境剧情预设功能 #53
This file contains hidden or 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 Android APK | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install --ignore-scripts --no-fund --no-audit | |
| - name: Build Web App | |
| run: node node_modules/vite/bin/vite.js build | |
| env: | |
| VITE_GITHUB_CLIENT_ID: ${{ secrets.VITE_GITHUB_CLIENT_ID }} | |
| - name: Sync Capacitor | |
| run: node node_modules/@capacitor/cli/bin/capacitor sync android | |
| env: | |
| CI: true | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Accept Android Licenses | |
| run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses 2>/dev/null || true | |
| - name: Build Debug APK | |
| run: | | |
| cd android | |
| chmod +x gradlew | |
| ./gradlew assembleDebug | |
| - name: Upload Debug APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: moran-jianghu-debug-apk | |
| path: android/app/build/outputs/apk/debug/app-debug.apk | |
| retention-days: 7 |