Android CI #34
Workflow file for this run
This file contains 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: 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/uuMusic-${{ github.event.release.tag_name }}.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 }} |