Skip to content

fix: add debounce and stop the loop #472

fix: add debounce and stop the loop

fix: add debounce and stop the loop #472

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main" ]
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract versionCode and versionName
id: get_versions
run: |
./gradlew -q printVersionCodeAndName > version_output.txt
cat version_output.txt
echo "VERSION_CODE=$(grep VERSION_CODE version_output.txt | cut -d '=' -f2)" >> $GITHUB_ENV
echo "VERSION_NAME=$(grep VERSION_NAME version_output.txt | cut -d '=' -f2)" >> $GITHUB_ENV
- name: Run unit tests
run: ./gradlew testDebugUnitTest
- name: Run lint
run: ./gradlew lintDebug
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug-${{ env.VERSION_NAME }}
path: app/build/outputs/apk/debug/app-debug.apk
retention-days: 2
# Do a signed release
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Show GitHub context
run: |
echo "github.ref=${{ github.ref }}"
echo "github.repository=${{ github.repository }}"
echo "github.repository_owner=${{ github.repository_owner }}"
echo "github.event_name=${{ github.event_name }}"
- name: Print package name (not secret)
run: echo "packageName=com.ilseon"
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Extract versionCode and versionName
id: get_versions
run: |
./gradlew -q printVersionCodeAndName > version_output.txt
cat version_output.txt
echo "VERSION_CODE=$(grep VERSION_CODE version_output.txt | cut -d '=' -f2)" >> $GITHUB_ENV
echo "VERSION_NAME=$(grep VERSION_NAME version_output.txt | cut -d '=' -f2)" >> $GITHUB_ENV
- name: Decode Keystore
run: echo "${{ secrets.KEYSTORE_JKS_BASE64 }}" | base64 --decode > ${{ github.workspace }}/keystore.jks
- name: Build Release App Bundle
run: ./gradlew bundleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_STORE_FILE_PATH: ${{ github.workspace }}/keystore.jks
- name: Upload Release AAB
uses: actions/upload-artifact@v4
with:
name: app-release-${{ env.VERSION_NAME }}
path: app/build/outputs/bundle/release/app-release.aab
retention-days: 5
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.PLAY_STORE_SERVICE_ACCOUNT_JSON }}
packageName: com.ilseon
releaseFiles: app/build/outputs/bundle/release/app-release.aab
track: internal
status: draft