fix: save enter mode #157
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: Unity Build with Cake (Android) | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| build: | |
| if: contains(github.event.head_commit.message, '#build') | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/sinlessdevil/unity-ci-image:2023.2.1f1 | |
| credentials: | |
| username: ${{ secrets.USERNAME }} | |
| password: ${{ secrets.CR_PAT }} | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| steps: | |
| - name: 🧾 Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: 💾 Cache Unity Library | |
| uses: actions/cache@v4 | |
| with: | |
| path: Library | |
| key: Library-${{ runner.os }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
| restore-keys: | | |
| Library-${{ runner.os }}- | |
| - name: 🪪 Activate Unity Pro License (.ulf) | |
| run: | | |
| mkdir -p /root/.local/share/unity3d/Unity | |
| echo "${UNITY_LICENSE}" | base64 -d > /root/.local/share/unity3d/Unity/Unity_lic.ulf | |
| echo "✅ License file written to /root/.local/share/unity3d/Unity/Unity_lic.ulf" | |
| - name: 🛠️ Build APK via Unity | |
| run: | | |
| echo "🔧 Starting Unity build..." | |
| /opt/unity/Unity/Unity \ | |
| -batchmode -nographics -quit \ | |
| -projectPath . \ | |
| -executeMethod Plugins.CI.Editor.Builder.BuildAndroidAPK_Dev \ | |
| -logFile /root/unity.log || echo "❌ Unity crashed" | |
| echo "------ UNITY LOG ------" | |
| cat /root/unity.log || echo "❌ Unity log not found" | |
| - name: 🧪 Run Cake pipeline (tests, logs) | |
| run: | | |
| dotnet tool restore | |
| dotnet cake build.cake --target=Run-CI-Pipeline | |
| - name: 📤 Upload APK Artifact | |
| if: success() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AndroidBuild | |
| path: artifacts/*.apk |