ci: automate GitHub Release with TV and Mobile APKs

This commit is contained in:
vndangkhoa 2026-01-02 23:51:58 +07:00
parent f843db9bff
commit 1eb497a089

View file

@ -104,6 +104,55 @@ jobs:
path: android-tv/app/build/outputs/apk/debug/*.apk
retention-days: 7
# ====================
# Android Mobile Build
# ====================
mobile-build:
name: Android Mobile Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
cache: 'gradle'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: |
cd frontend
npm install
- name: Build Web App
run: |
cd frontend
npm run build
- name: Grant execute permission
run: chmod +x frontend/android/gradlew
- name: Build Mobile APK
run: |
cd frontend/android
./gradlew assembleDebug --no-daemon
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: android-mobile-debug
path: frontend/android/app/build/outputs/apk/debug/*.apk
retention-days: 7
# ====================
# Docker Build
# ====================
@ -135,7 +184,7 @@ jobs:
sleep 10
curl -f http://localhost:8000/api/health || exit 1
docker stop test
# ====================
# Docker Publish (on main only)
# ====================
@ -172,3 +221,38 @@ jobs:
${{ secrets.DOCKERHUB_USERNAME }}/streamflow:${{ steps.version.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
# ====================
# Release (on tags only)
# ====================
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [android-build, mobile-build]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download TV APK
uses: actions/download-artifact@v4
with:
name: android-tv-debug
path: apks/tv
- name: Download Mobile APK
uses: actions/download-artifact@v4
with:
name: android-mobile-debug
path: apks/mobile
- name: Prepare APKs
run: |
mv apks/tv/*.apk StreamFlix-TV.apk
mv apks/mobile/*.apk StreamFlix.apk
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
StreamFlix-TV.apk
StreamFlix.apk
generate_release_notes: true