f185e5faec
Build Android APK / build (push) Has been cancelled
Gradle + NDK + node_modules exhaust the 14 GB on ubuntu-latest runners. Remove .NET, Haskell, Chromium, Swift, PowerShell preinstalled tools (~6 GB). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
name: Build Android APK
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: build-android-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Free disk space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet /usr/local/share/boost /opt/ghc
|
|
sudo rm -rf /usr/local/share/chromium /usr/local/share/powershell
|
|
sudo rm -rf /usr/share/swift /usr/local/julia*
|
|
sudo apt-get autoremove -y > /dev/null 2>&1
|
|
sudo apt-get clean
|
|
df -h
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: gradle-
|
|
|
|
- name: Generate Android native project
|
|
run: npx expo prebuild --platform android --clean
|
|
|
|
- name: Build debug APK
|
|
working-directory: android
|
|
run: |
|
|
chmod +x gradlew
|
|
./gradlew assembleDebug --no-daemon
|
|
|
|
- name: Upload APK artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: SheetHappens-debug-${{ github.ref_name }}
|
|
path: android/app/build/outputs/apk/debug/app-debug.apk
|
|
retention-days: 30
|
|
|
|
- name: Create GitHub Release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh release create ${{ github.ref_name }} \
|
|
android/app/build/outputs/apk/debug/app-debug.apk#SheetHappens-${{ github.ref_name }}.apk \
|
|
--title "SheetHappens ${{ github.ref_name }}" \
|
|
--generate-notes
|