name: Android CI env: # The name of the main module repository main_project_module: app on: push: branches: [ "main" ] pull_request: branches: [ "main" ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'corretto' cache: gradle - uses: gradle/gradle-build-action@v2 with: gradle-version: 7.5 - name: Create base64 jks file run: echo "${{ secrets.BASE_64_SIGNING_KEY }}" > app/release_keystore.txt - name: Create jks file run: base64 -d "app/release_keystore.txt" > app/release_keystore.jks - name: Create Blank Local Properties FIle run: touch local.properties - name: Create Keystore Properties File run: echo "${{ secrets.LOCAL_PROPERTIES }}" > keystore.properties - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle run: ./gradlew build - name: Set current date as env variable run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV # Create APK Debug - name: Build apk debug project (APK) run: ./gradlew assembleDebug # Create APK Release - name: Build apk release project (APK) run: ./gradlew assemble # Upload Artifact Build # Noted For Output [main_project_module]/build/outputs/apk/debug/ - name: Upload APK Debug uses: actions/upload-artifact@v3 with: name: YTDLnis APK debug generated path: ${{ env.main_project_module }}/build/outputs/apk/debug/ # Noted For Output [main_project_module]/build/outputs/apk/release/ - name: Upload APK Release uses: actions/upload-artifact@v3 with: name: YTDLnis APK release generated path: ${{ env.main_project_module }}/build/outputs/apk/release/ - name: send telegram message on push or pull continue-on-error: true uses: appleboy/telegram-action@master with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} message: | ${{ github.actor }} created commit: Commit message: ${{ github.event.commits[0].message }} Repository: ${{ github.repository }} See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}