Skip to content

Android CI

Android CI #35

Workflow file for this run

name: Android CI
on:
release:
types: [ created ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assembleRelease
- name: Upload APK asset to Release
if: success() # Only upload if the release was created successfully
uses: actions/[email protected]
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: app/release/*.apk
asset_name: "uuMusic-${{ github.event.release.tag_name }}" # You can modify the name as needed
asset_content_type: application/vnd.android.package-archive
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}