Added WindowCompat to address status bar color being white in system … #19
Workflow file for this run
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: Build and Upload APK | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build Pokedex App | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # Extract versionName and versionCode from the tag | |
| - name: Extract version info | |
| id: extract_version | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION_NAME=$(echo $TAG_NAME | sed 's/^v//' | cut -d'-' -f1) | |
| VERSION_CODE=$(echo $TAG_NAME | cut -d'-' -f2) | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| # Set up JDK for Android | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| # Set up Android SDK | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| # Build the APK with versionName and versionCode | |
| - name: Build APK | |
| run: | | |
| ./gradlew assembleDebug -PversionName=$VERSION_NAME -PversionCode=$VERSION_CODE | |
| # Find the generated APK file | |
| - name: Find APK | |
| id: find_apk | |
| run: | | |
| APK_PATH=$(find app/build/outputs/apk -name "app-*.apk" | head -n 1) | |
| echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV | |
| echo "APK_NAME=$(basename $APK_PATH)" >> $GITHUB_ENV | |
| # Create a GitHub Release | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Upload APK to GitHub Release | |
| - name: Upload APK to Release | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ${{ env.APK_PATH }} | |
| asset_name: ${{ env.APK_NAME }} | |
| asset_content_type: application/vnd.android.package-archive | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |