mac fix build #41
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: Bruce Android Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v2 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v2 | |
| with: | |
| api-level: 34 | |
| build-tools: 34.0.0 | |
| - name: Install Android SDK packages | |
| run: | | |
| yes | sdkmanager "platforms;android-34" "build-tools;34.0.0" | |
| - name: Accept Android SDK licenses | |
| run: | | |
| yes | sdkmanager --licenses | |
| # Chaquopy targets Python 3.8, and only emits .pyc when the build interpreter | |
| # matches. Without this the APK ships .py and the phone compiles esptool on the | |
| # first flash. Runner images no longer carry 3.8, so install it and make it python3. | |
| - name: Set up Python 3.8 for Chaquopy | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| "$HOME/.local/bin/uv" python install --default 3.8.18 | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Verify python3 is 3.8 | |
| run: | | |
| python3 -V | |
| python3 -V | grep -q '^Python 3\.8\.' || { | |
| echo "::error::python3 is not 3.8 — Chaquopy would ship .py instead of .pyc" | |
| exit 1 | |
| } | |
| - name: Build with Gradle | |
| run: ./gradlew clean assembleRelease | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: app/build/outputs/apk/release/*.apk | |